我正试图下载一个大型的纽约出租车数据库,公开可在NYC TLC website。Fread不寻常的行结束导致错误
library(data.table)
feb14 <- fread('https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2014-02.csv', header = T)
执行上述代码成功下载数据(需要几分钟),但由于内部错误而无法解析。我也尝试删除header = T
。
有没有解决方法来处理fread
中的“不寻常的行结束”?
Error in fread("https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2014-02.csv", :
Internal error. No eol2 immediately before line 3 after sep detection.
In addition: Warning message:
In fread("https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2014-02.csv", :
Detected eol as \n\r, a highly unusual line ending. According to Wikipedia the Acorn BBC used this. If it is intended that the first column on the next row is a character column where the first character of the field value is \r (why?) then the first column should start with a quote (i.e. 'protected'). Proceeding with attempt to read the file.
我希望我知道几分钟将是20和文件大小是> 2演出:)。无论如何,一旦文件被读取,我就会查看它。 – Drj
顺便说一句,这里最好[mcve]。在这种情况下,最小可能意味着做一个不是2 GB的例子;并且可重复使用意味着不会使用可能在某个时候断开的链接... – Frank