cbind和R中的联合收割机

cbind和R中的联合收割机,r,R,我有点困惑: 我有一个变量gene函数c将向量组合起来,生成一个向量字符 class(c(gene,gene)) [1] "character" >代码> cBin(基因,基因)< /C> >将基因作为一个垂直向量,并将它们组合成一个矩阵: class(cbind (gene, gene)) [1] "matrix" 从R帮助?cbind: 按行或列组合R对象 说明: Take a sequence of vector, matrix or data-frame arguments

我有点困惑:
我有一个变量
gene函数
c
将向量组合起来,生成一个向量字符

class(c(gene,gene)) 
[1] "character"
<> >代码> cBin(基因,基因)< /C> >将<代码>基因<代码>作为一个垂直向量,并将它们组合成一个矩阵:

 class(cbind (gene, gene))
[1] "matrix"
从R帮助
?cbind

按行或列组合R对象

说明:

 Take a sequence of vector, matrix or data-frame arguments and
 combine by _c_olumns or _r_ows, respectively.  These are generic
 functions with methods for other R classes.

c
函数组合矢量并生成矢量字符

class(c(gene,gene)) 
[1] "character"
<> >代码> cBin(基因,基因)< /C> >将<代码>基因<代码>作为一个垂直向量,并将它们组合成一个矩阵:

 class(cbind (gene, gene))
[1] "matrix"
从R帮助
?cbind

按行或列组合R对象

说明:

 Take a sequence of vector, matrix or data-frame arguments and
 combine by _c_olumns or _r_ows, respectively.  These are generic
 functions with methods for other R classes.

你是否期待着
cbind(matrix(gene,nrow=1),matrix(gene,nrow=1))
,明白了
cbind
始终在矩阵中以蛇形顺序排列向量元素。谢谢,收到了
cbind
始终在矩阵中以蛇形顺序排列向量元素。