rreadxl

Reading Excel: evaluation error with zip file '..file.xlsx' cannot be opened


I am using R with readxl package. I try to import an Excel file with the following command:

library(readxl)
city_codes <- read_excel("./data/file.xlsx", sheet = "city_codes")

It says it is a zip file and cannot be opened:

Error in sheets_fun(path) : 
Evaluation error: zip file './data/file.xlsx' cannot be opened.

Any ideas?


Solution

  • The error message is readxl's funny way of saying "file not found". That exact line of code gives me the exact same error, and the file doesn't even exist for me.

    Note: I'm on version 1.0.0 of readxl