使用 read_xlsx 时加载巨大的 excel 文件 (100mb) 时出现问题。 Returns 在某些单元格中错误地 "TRUE"

Problem with loading huge excel file(100mb) when using read_xlsx. Returns wrongly "TRUE" in some cells

我正在处理一个巨大的数据框,从 excel 文件加载它时遇到了一些问题。我只能使用 readxl 包中的 read_xlsx 加载它。但是我现在已经意识到某些单元格包含 "TRUE" 而不是 excel 文件中的实际值。它如何错误地加载文件,有什么解决方案可以避免这种情况吗?

按照这个建议解决了问题。

JasonAizkalns: Hard to tell, but this may be caused from allowing read_xlsx to "guess" the column types. If you know the column type beforehand, it's always best to specify them with the col_types parameter. In this case, it may have guessed that column type was logical when really it's supposed to be something else (say, text or numeric)

从具有 none 数值的列中清理数据集,然后使用 x<-read_xlsx(filename, skip = 1, col_types = "numeric")。此后我 y<- read_xlsx(filename, skip = 1, col_types = "date") 在包含日期的列上。我使用 cbind(y,x) 来完成带有 none 数字列的数据集。如果缺少很多值,read_xlsx 似乎会误解具有数值的列。