[英]R Error: Cannot read in xls spreadsheet in R, gives “Error in file.exists(tfn) : invalid 'file' argument”
我正在嘗試從Doing Data Science一書中進行練習,在此代碼下,我會不斷出錯。
mt <- read.xls("rollingsales_manhattan.xls", perl="C:\\Perl64\\bin\\perl.exe", pattern="BOROUGH",stringsAsFactors=FALSE)
出現此錯誤...
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
我已經將該perl值添加到我的方法調用中,以指定Perl解釋器在我的計算機上的位置。 我確保工作目錄正確並且文件名正確...執行以下命令進行驗證...
> 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"
有什么幫助嗎?
從頭開始重新啟動R Studio可以解決此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.