程序需要一个429497 x 429497大小的矩阵,初始化代码如下:
temp=matrix(0,429497,429497)
</p>
结果R给出如下错误信息,提示内存不够。
Error in matrix(0, 429497, 429497) : too many elements specified
我尝试用ff包把变量存储在disk上
x<-ff(0,dim=c(429497,429497)
</p>
结果还是出错:
Error in if (length < 0 || length > .Machine$integer.max) stop("length must be between 1 and .Machine$integer.max") :
missing value where TRUE/FALSE needed
In addition: Warning message:
In ff(0, dim = c(429497, 429497)) : NAs introduced by coercion
查了一下,跑程序用的unix服务器还有33G多的内存,
> .Machine$integer.max
[1] 2147483647
请问要怎么解决这个生成高维矩阵的问题[s:16]
谢谢!