我一直在尝试阅读 excel 文件,但似乎有问题。
该文件以 Excel 格式存储在 Documents 文件夹中。
这些是我收到的错误消息:
table <- read.csv(file.choose(),header=T,sep='\t')
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote, :
line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on
另外,由于这些是警告,我碰巧忽略了它们。但是也没有任何内容被读入“表格”:
table
# [1] PK...
# <0 rows> (or 0-length row.names)
最佳答案
read.csv
不读取 XLS(X) 文件,只读取 CSV 文件。尝试在 Excel 中打开您的 Excel 文件,将其导出为 CSV 并重新发布您的 read.csv
命令(根据您的系统语言,您可能希望使用 read.csv2
代替)。
关于Read.csv() 抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25872946/