【发布时间】:2015-02-09 16:20:31
【问题描述】:
> tem = 1:9801
> dim(as.matrix(tem,nrow=99,ncol=99))
[1] 9801 1
> dim(matrix(tem,nrow=99,ncol=99))
[1] 99 99
我相信“as.matrix”函数可以将向量转换为具有预先指定的行数和列数的矩阵。 但正如您在上面的 R 结果中看到的那样,'as.matrix' 函数没有,但 'matrix' 函数有。 为什么 'as.matrix' 函数不能正常工作?
【问题讨论】:
标签: r