data.table v 10.5

时间:2017-03-30 16:39:43

标签: r data.table

不幸的是,您将无法重现错误,因为这将需要发布数据,我不能这样做,但错误如下。 当我以下列方式阅读文件时:

for (i in 1:length(folders)){
  setwd(folders[i])
  files_to_loop<-list.vector()
  for (j in 1:length(files_to_loop){
    data_aux<-fread(files_to_loop[j],sep=",",encoding="UTF-8",header=TRUE)
  }
}

我收到此错误:

Parameter na.strings == <<NA>>
None of the 1 na.strings are numeric (such as '-9999').
Input contains no \n. Taking this to be a filename to open
File opened, filesize is 1.380467 GB.
Memory mapping ... ok
Detected eol as \r\n (CRLF) in that order, the Windows standard.
Positioned on line 1 starting: <<filename,ETP,ETP_code,ETP_name>>
Using supplied sep ','
  sep==','(ascii 44)  with 101 lines of 203 fields using quote rule 0
  sep==','(ascii 44)  with 433261568 lines of 1488633016 fields using quote rule 3
Error in fread(files_to_loop[j], colClasses = c("character"), sep = ",",  : 
  Internal error: first line has field count 232 but expecting 1488633016

然后,如果我然后返回并执行:

data_aux<-fread(files_to_loop[j],sep=",",encoding="UTF-8",header=TRUE)

然后一切都很好,消息是这样的:

Parameter na.strings == <<NA>>
None of the 1 na.strings are numeric (such as '-9999').
Input contains no \n. Taking this to be a filename to open
File opened, filesize is 1.380467 GB.
Memory mapping ... ok
Detected eol as \r\n (CRLF) in that order, the Windows standard.
Positioned on line 1 starting: <<filename,ETP,ETP_code,ETP_name>>
Using supplied sep ','
  sep==','(ascii 44)  with 101 lines of 203 fields using quote rule 0
Detected 203 columns on line 1. This line is either column names or first data row (first 30 chars): <<filename,ETP,ETP_code,ETP_name>>
All the fields on line 1 are character fields. Treating as the column names.    

在版本10.4上一切都运行良好但不幸的是fread()不是多线程的。

0 个答案:

没有答案