我正在使用data.table包中的fread()函数并处理凌乱的输入文件。一些线路末端有一个额外的回车。是否可以忽略^ M?
我可以通过其他方式对其进行预处理,但如果我可以直接使用fread来处理它...
它目前给我这个错误:
Error in fread(s$file, sep = "\t", nrows = 1, skip = 0, header = FALSE) :
Line ending is \r\r\n. R's download.file() appears to add the extra \r in
text mode on Windows. Please download again in binary mode (mode='wb')
which might be faster too. Alternatively, pass the URL directly to
fread and it will download the file in binary mode for you.