Reputation: 273
I am trying to import the data in my Excel file into R using Openxlsx library:
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
Upvotes: 6
Views: 8598
Reputation: 81
There's also another possibility: the XLSX file could be password protected. If you delete the password, then this can fix the error.
Upvotes: 3
Reputation: 1
I think the best way to solve this problem is to reset the pathway of your data source. Please do not include any characters without English in your pathway.
setwd("C:\\Users\\your path way (where you store datafile.xlsx)")
P.S. Rstudio2021 seem not friendly to non-English user ☺☺☺
Upvotes: 0
Reputation: 273
This error is thrown because your Excel file is open. Save and close the Excel file and try again, it will work.
Upvotes: 7