0
我有一個CSV文件。它的大小是300MB。我想用這個命令來完成每一列FFT:運行傅立葉變換時R中「無法分配矢量大小n mb」
apply(df,2,function(x){fft(x[!is.na(x)])})
,但我得到這個錯誤:
Error: cannot allocate vector of size 293.0 Mb
In addition: Warning messages:
1: In as.matrix.data.frame(X) :
Reached total allocation of 1535Mb: see help(memory.size)
2: In unlist(X, recursive = FALSE, use.names = FALSE) :
Reached total allocation of 1535Mb: see help(memory.size)
3: In unlist(X, recursive = FALSE, use.names = FALSE) :
Reached total allocation of 1535Mb: see help(memory.size)
4: In aperm.default(X, c(s.call, s.ans)) :
Reached total allocation of 1535Mb: see help(memory.size)
5: In aperm.default(X, c(s.call, s.ans)) :
Reached total allocation of 1535Mb: see help(memory.size)
6: In aperm.default(X, c(s.call, s.ans)) :
Reached total allocation of 1535Mb: see help(memory.size)
7: In aperm.default(X, c(s.call, s.ans)) :
Reached total allocation of 1535Mb: see help(memory.size)
我使用Windows 7-32位,如果我運行此命令memory.limit()
結果3000
我該如何解決我的問題?我不能購買更多的內存;)
檢查'apply'中的源代碼,你會發現它只是一個循環。 –