1

I am trying to read a big excel file with almost 30000 rows and 6000 columns.

I have tested XLConnect and XLSX package, but I get java I/O error:

java.io.IOException: ZIP entry size is too large

How can I read such a big xlsx file in r?

Kaja
  • 2,962
  • 18
  • 63
  • 99
  • 4
    Convert it to .csv - IMO the best solution to read in big excel files is not to read excel files... – EDi Feb 06 '14 at 11:20
  • I cant convert it to CSV too :/ – Kaja Feb 06 '14 at 11:22
  • Are you using 64-bit R and 64-bit Java? – Richie Cotton Feb 06 '14 at 11:43
  • No, I am using 32 bit – Kaja Feb 06 '14 at 12:20
  • 1
    Why can't you save the Excel sheet as a csv? If you're getting an error there, the problem may be a corrupt workbook, not a java error. – Carl Witthoft Feb 06 '14 at 12:28
  • 1
    I noticed that it's faster to import .xls files compared to .xlsx – nassimhddd Feb 06 '14 at 12:55
  • See [here](http://www.r-bloggers.com/read-excel-files-from-r/) for a list of things to try. Also, see [here](http://stackoverflow.com/questions/7963393/out-of-memory-error-java-when-using-r-and-xlconnect-package) for two waya to deal with Java problems associated with XLConnect. The bottom line is this though: if you have a large Excel file and can't read it: *convert to csv*. – jlhoward Feb 06 '14 at 20:10

1 Answers1

2

You can increase the memory available to java in the options (in R). Typically like this:

options(java.parameters = "-Xmx1000m")
data <- read.xlsx(filepath)
nassimhddd
  • 8,340
  • 1
  • 29
  • 44