简体   繁体   English

关于如何调试此FF错误的任何想法?

[英]Any ideas on how to debug this FF error?

I am trying to use FF to read a large CSV file in R. 我正在尝试使用FF在R中读取大型CSV文件。

I first read the first 10 rows of the code with csv.read to make sure I'm not doing anything stupid: 我首先使用csv.read阅读代码的前10行,以确保我没有做任何愚蠢的事情:

trainFileName = "./TrainingSet/SplitFiles/7_train_data.csv"
trainSet <- read.csv(trainFileName, header=TRUE, nrows=10)
length(trainSet[1,])
length(trainSet[,1])

This tells me: 这告诉我:

> trainFileName = "./TrainingSet/SplitFiles/7_train_data.csv"
> trainSet <- read.csv(trainFileName, header=TRUE, nrows=10)
> length(trainSet[1,])
[1] 4505
> length(trainSet[,1])
[1] 10

So far so good. 到现在为止还挺好。 Now I try to repeat this feat with FF: 现在,我尝试用FF重复这一壮举:

trainSet <- read.csv.ffdf(file = trainFileName, header = TRUE, nrows = 10, VERBOSE = TRUE)

And here we fail with: 在这里,我们失败了:

read.table.ffdf 1..10 (10)  csv-read=0.552sec
Error in if (dfile ==         getOption("fftempdir")) finalizer <- "delete" else finalizer <- "close" : argument is of length zero
Error in setwd(cwd) : character argument expected

I can't find any more info on this error anywhere, and I can't see how I can do anything simpler, so before I delve into the FF source, does anyone have any ideas? 我在任何地方都找不到有关此错误的更多信息,也看不到如何做得更简单,因此在探究FF源之前,有没有人有任何想法?

I've tried loading the whole file instead of the first 10 rows, specifying column data types and always the same error. 我尝试加载整个文件而不是前10行,指定列数据类型,并且始终出现相同的错误。

Thanks in advance. 提前致谢。

yes, you have too many columns. 是的,您的栏太多。 In ff, each column is a file. 在ff中,每一列都是一个文件。 You can not open more files than your filesystem can open at the same time 您打开的文件数量不能超过文件系统可以同时打开的数量

To have a look where ff will fail if you have too many files open run this: 要查看如果打开的文件太多,ff将会失败的地方,请运行以下命令:

require(ff)
x <- list()
for(i in 1:100000){
  print(i)
  x[[i]] <- ff(rnorm(10))
  open(x[[i]] )
}

For me, this failed at 1022 open files but I still had a few other open as well. 对我来说,这在1022年打开文件时失败了,但是我还有其他一些打开的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM