[英]Import Excel data into R using openxlsx: Error in file(con, "r") : invalid 'description' argument
I am trying to import the data in my Excel file into R using Openxlsx library:我正在尝试使用 Openxlsx 库将 Excel 文件中的数据导入 R :
library(openxlsx)
data <- read.xlsx("datafile.xlsx", sheet = "Sheet1")
However, I get the following error:但是,我收到以下错误:
Error in file(con, "r") : invalid 'description' argument
In addition: Warning message:
In unzip(xlsxFile, exdir = xmlDir) : error 1 in extracting from zip file
This error is thrown because your Excel file is open.抛出此错误是因为您的 Excel 文件已打开。 Save and close the Excel file and try again, it will work.
保存并关闭 Excel 文件并重试,它会工作。
Error is also returned when file is password-protected文件受密码保护时也会返回错误
I'm currently having this issue, but I have confirmed (multiple times) that the files of interest are closed.我目前遇到此问题,但我已(多次)确认感兴趣的文件已关闭。 I have also restarted my computer.
我也重新启动了我的电脑。 Any ideas about what could be causing this besides an open file?
除了打开的文件之外,关于什么可能导致此问题的任何想法?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.