read.csv停止读取行523924,即使你的文件有799992行 [英] read.csv stops reading at row 523924 even thouhg the file has 799992 rows
问题描述
任何想法为什么R会停止读取文件,在它到达之前?
Any idea why R would stop reading the file before it gets to the end?
我可以在excel中打开文件,它显示完整的799992.R只读取文件的65%。我已经将文件保存为csv从Excel,但它没有更改R能够读取的行数。
I can open the file in excel, and it shows the full 799992. R reads only 65% of the file. I have saved the file as csv from Excel, but it did not change the number of rows R was able to read. In fact it stops reading at the exact same location every time.
我使用以下命令。
lem1 <- read.csv("lem1.csv", header=TRUE, sep =",")
我对类似的数据文件有相同的问题,它只读取57%的文件,并停止正常
I have the same issue on a similar data file, it only reads 57% of the file and stops "normally"
推荐答案
如果数据具有不匹配的引号或八角形(或在某些操作系统cntrl-Z中),则可能会发生文件读取的异常终止。有时,您可以通过重置quote和comment.char的默认值来获得满意的结果:
If the data has mismatched quotes or octothorpes (or in some OSes cntrl-Z's) then abnormal termination of the file read may occur. You can sometimes get satisfactory results by resetting the defaults for quote and comment.char:
lem1 <- read.csv("lem1.csv", header=TRUE, sep =",",
quote="", comment.char="")
这篇关于read.csv停止读取行523924,即使你的文件有799992行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!