cbind2(methods)
cbind2()所属R语言包:methods
Combine two Objects by Columns or Rows
结合两个对象的行或列
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Combine two matrix-like R objects by columns (cbind2) or rows (rbind2). These are (S4) generic functions with default methods.
结合两个矩阵R对象列(cbind2)或行(rbind2)。这是默认的方法(S4)的通用功能。
用法----------Usage----------
cbind2(x, y)
rbind2(x, y)
参数----------Arguments----------
参数:x
any R object, typically matrix-like.
任何R对象,典型的矩阵类。
参数:y
any R object, typically similar to x, or missing completely.
任何R对象,通常类似x,或完全丢失。
Details
详情----------Details----------
The main use of cbind2 (rbind2) is to be called by cbind() (rbind()) if these are activated. This allows cbind (rbind) to work for formally classed (aka "S4") objects by providing S4 methods for these objects. Currently, a call<br> methods:::bind_activation(TRUE)<br> is needed to install a cbind2-calling version of cbind (into the base namespace) and the same for rbind.<br> methods:::bind_activation(FALSE) reverts to the previous internal version of cbind which does not build on cbind2, see the examples.
主要用途cbind2(rbind2)是被称为cbind()(rbind()),如果这些被激活。这使得cbind(rbind)(又名“S4”)正式归入对象为这些对象提供S4方法。目前,呼叫参考methods:::bind_activation(TRUE)参考需要安装一个cbind2cbind(base命名空间)和相同的版本调用rbind参考methods:::bind_activation(FALSE)恢复到以前的cbind不cbind2,看到的例子建立的内部版本。
值----------Value----------
A matrix (or matrix like object) combining the columns (or rows) of x and y.
A矩阵(或类似物件的矩阵)结合x和y列(或行)。
方法----------Methods----------
signature(x = "ANY", y = "ANY") the default method
signature(x = "ANY", y = "ANY")默认的方法
signature(x = "ANY", y = "missing") the default method
signature(x = "ANY", y = "missing")默认的方法
参见----------See Also----------
cbind, rbind; further, cBind, rBind in the Matrix package.
cbind,rbind;进一步,cBind,rBindMatrix包。
举例----------Examples----------
cbind2(1:3, 4)
m <- matrix(3:8, 2,3, dimnames=list(c("a","b"), LETTERS[1:3]))
cbind2(1:2, m) # keeps dimnames from m[保持米dimnames]
### Note: Use the following activation if you want cbind() to work[#注意:如果你想cbind()工作,使用以下激活]
### ---- on S4 objects -- be careful otherwise![##关于S4对象----否则 - 要小心!]
methods:::bind_activation(on = TRUE)
trace("cbind2")
cbind(a=1:3)# no call to cbind2()[没有呼叫cbind2()]
cbind(a=1:3, four=4, 7:9)# calling cbind2() twice[致电cbind2()两次]
untrace("cbind2")
cbind(m, a=1, b=3)
## turn off the `special cbind()' :[#关闭特别cbind():]
methods:::bind_activation(FALSE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|