簡體   English   中英

使用 openxlsx 將 Excel 數據導入 R:文件中的錯誤(con,“r”):無效的“描述”參數

[英]Import Excel data into R using openxlsx: Error in file(con, "r") : invalid 'description' argument

我正在嘗試使用 Openxlsx 庫將 Excel 文件中的數據導入 R :

library(openxlsx)
data <- read.xlsx("datafile.xlsx", sheet = "Sheet1")

但是,我收到以下錯誤:

Error in file(con, "r") : invalid 'description' argument
In addition: Warning message:
In unzip(xlsxFile, exdir = xmlDir) : error 1 in extracting from zip file

拋出此錯誤是因為您的 Excel 文件已打開。 保存並關閉 Excel 文件並重試,它會工作。

文件受密碼保護時也會返回錯誤

我目前遇到此問題,但我已(多次)確認感興趣的文件已關閉。 我也重新啟動了我的電腦。 除了打開的文件之外,關於什么可能導致此問題的任何想法?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM