awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
363 stars 79 forks source link

Expecting a single value in a read.xlsx.default call #262

Open andreamoro opened 7 years ago

andreamoro commented 7 years ago

Using the following snippet,

xlsxFile <- file.choose()
df1 <- read.xlsx(xlsxFile = xlsxFile, sheet = 1, skipEmptyRows = FALSE)

the error below is returned

Error in read.xlsx.default(xlsxFile = xlsxFile, sheet = 1, skipEmptyRows = FALSE) : 
  expecting a single value

After several failed attempts, I though the progrem could have lied into the XLSX file and so it was. My tabs (autogenerated by a software) all started with a number formiing a sequence (e.g. 1 - TabXY, 2 - TabXY) prepended to split the the huge amount of data leaving them into a single file. Once the sequence was removed, the problem gone.

Katzmann commented 6 years ago

I had the same error message with an excel file. The excel file was automatically generated by SAP WebAS. After opening and storing the fiel within excel, the error was gone.

Rockbaron commented 6 years ago

Very very useful tipp. Never thought of that. open and safe cleared the problem. Thanks