1
I have a file .xlsx
which I need to read in R. The tab is variable, so I use a code first to check which tab is the most recent, but when using the function read_excel
package readxl
, returns the following error:
Erro: `path` does not exist: ‘Dados/Previso~es Imperial College.xlsx’
Before, I’m using a setwd
to set the folder where all the files are. Inside the folder COVID-19
there is a folder Dados
. What I don’t understand is that function excel_sheets
, which is from the same package, can read the file normally.
Code I am using:
library(readxl)
setwd("~/GitHub/COVID-19") #Exemplo
abas <- length(excel_sheets("Dados/Previsões Imperial College.xlsx"))
aba <- excel_sheets("Dados/Previsões Imperial College.xlsx")[abas]
dia <- read_excel("Dados/Previsões Imperial College.xlsx",
sheet = aba, range = "B1:B1", col_names = FALSE)
Link to the spreadsheet: https://drive.google.com/file/d/1EB23dikhYUMnaSdQLTA8Bb00FhrdVyJ-/view?usp=sharing
Try renaming the file by removing spaces and accented letters from its name.
– Marcus Nunes
I was looking for an explanation for one function of the package to read the file and the other not. But thanks for the tip.
– Alexandre Sanches