我正在尝试在ff中创建一个巨大的矩阵,并且我知道ff对于这种事情很有用。
但是,存在一个主要问题。矩阵的尺寸超过.Machine $ max_integer!我正在使用64位R和64位ff的64位计算机上运行。
有什么办法可以解决这个问题?
建议R使用stdint.h中的MAXINT值。有什么方法可以解决此问题,而无需更改该文件并可能破坏构建?
> ffMatrix <- ff(vmode="boolean", dim=c(300000,300000))
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(vmode = "boolean", dim = c(300000, 300000)) :
NAs introduced by coercion
> 300000**2 > .Machine$integer.max
[1] TRUE
最佳答案
那仍然是一个非常大的矩阵,您需要一台并行计算机:-)。 300000x300000> 2 ^ 32(即使在64位计算机上,int也可能是32位)。
另请参见此link
关于r - 在ff中创建大型矩阵,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2751035/