- File: it is a file with about 100 rows and 7 columns. XLS extension (MS Excel 97-2003).
- Issue: unable to read in the file with R through
read.xlsx
orread.xlsx2
. Code used to try to read the file:
library(xlsxjars) library(rJava) library(xlsx) excel <- read.xlsx("File.xls",sheetIndex=1,startRow=1,stringsAsFactor=F)
Error prompted:
Error in
.jcall ("RJavaTools","Ljava/lang/object;","invokeMethod",cl,
: java.lang.IllegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream.
PD: for the record, I did try to read it with read.csv
and it does read it but since it's an Excel file and it's not separated by commas or dots, R reads it as if everything is in 1 column. Maybe anyone can suggest a way to read it through read.csv
?