简体   繁体   English

R错误:无法在R中的xls电子表格中读取,并显示“ file.exists(tfn)中的错误:无效的'file'参数”

[英]R Error: Cannot read in xls spreadsheet in R, gives “Error in file.exists(tfn) : invalid 'file' argument”

I'm trying to do an exercise from the Doing Data Science book, and at this code I keep erroring out. 我正在尝试从Doing Data Science一书中进行练习,在此代码下,我会不断出错。

mt <- read.xls("rollingsales_manhattan.xls", perl="C:\\Perl64\\bin\\perl.exe", pattern="BOROUGH",stringsAsFactors=FALSE)

With this error... 出现此错误...

Error in xls2sep(xls, sheet, verbose = verbose, ..., method = method,  : 
  Intermediate file 'C:\Users\carson\AppData\Local\Temp\RtmpMjMWfI\file267c48c84956.csv' missing!
Error in file.exists(tfn) : invalid 'file' argument

I've added that perl value to my method call, to specify where the Perl interpreter is on my machine. 我已经将该perl值添加到我的方法调用中,以指定Perl解释器在我的计算机上的位置。 I've made sure the working directory is correct and the file name is correct...doing the following command to verify... 我确保工作目录正确并且文件名正确...执行以下命令进行验证...

> list.files()
 [1] "Capture.PNG"                        "dds_ch2_rollingsales"              
 [3] "gross_sqft_vs_price.png"            "gross_sqft_vs_price_with_trend.png"
 [5] "load_cleandata.r"                   "model1 vs index.png"               
 [7] "model2 vs index.png"                "model2a vs index.png"              
 [9] "model3 vs index.png"                "model4 vs index.png"               
[11] "rollingsales_manhattan.xls"  

Any help? 有什么帮助吗?

从头开始重新启动R Studio可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM