I'm using the package openxlsx
to open a .xlsx file into R
. This is a basic example of the data I'm trying to read:
This is the code I use to read the excel:
read.xlsx("F:/Test.xlsx",colNames = T,detectDates = T)
but i get the following error:
Error in read.xlsx.default("F:/Test.xlsx", colNames = T, detectDates = T) :
basic_string::substr: __pos (which is 8) > this->size() (which is 2)
If I delete the first row of the excel I keep getting the same error. And it's really wired because the last time I run the script (2 weeks ago) the Excel was in the same format and I didn't get this error and I haven't updated R or Rstudio or the package.
I had the same problem, I changed on excel the format date from: 09/20/2017 to 09/20/17 and read.xlsx worked.