-2

i was trying to write new data frame in R using Write.xlsx.

i have 572988 rows and 25 column

i get this error:

Error in .jcheck(silent = FALSE) : 
Java Exception <no description because toString() failed>.jcall(row[[ir]], "Lorg/apache/poi/ss/usermodel/Cell;",   "createCell", as.integer(colIndex[ic] - 1))new("jobjRef", jobj = <pointer:  0x127f6dcb0>, jclass = "java/lang/OutOfMemoryError")

RStudio Version 1.1.453

MacBook Pro 2015

Version 10.14

Processor 2.2 core i7

Mj___3
  • 13
  • 8
  • Try using write.xlsx from the openxlsx package and not from the xlsx package. openxlsx has no java dependencies. – phiver Oct 07 '18 at 09:06
  • Isn't asking that many rows from Excel a bit... much? It would seem you're about [half way there](https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3). – Roman Luštrik Oct 07 '18 at 10:20

1 Answers1

0

It seems to me that you get an Java out of memory exception.

Here you find a description how you adjust the memory with the package XLConnect:

"Out of Memory Error (Java)" when using R and XLConnect package

For a general understanding, see:

https://www.journaldev.com/2856/java-jvm-memory-model-memory-management-in-java

Marcel
  • 502
  • 3
  • 11
  • See also: https://stackoverflow.com/questions/27153974/how-to-fix-outofmemoryerror-java-gc-overhead-limit-exceeded-in-r?noredirect=1&lq=1 – Marcel Oct 07 '18 at 09:17