0

New to R, new to stackoverflow. I need to take the Caravan dataset from the ISLR package and export it into Excel.

Here is my code and my error:

library(xlsx)
write.xlsx(Caravan, "c:/Users/me/Desktop/PRACTICE/R/Caravan.xlsx")

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
java.lang.OutOfMemoryError: Java heap space

Unsure how to troubleshoot this one - thoughts? Thanks.

Ben Kronk
  • 33
  • 8
  • 2
    As described [here](http://www.bramschoenmakers.nl/en/node/726), before loading the xlsx package, run the following code to increase the amount of space allocated `options( java.parameters = "-Xmx4g" )`. – eipi10 Feb 20 '17 at 20:36
  • 1
    It worked - thanks for pointing me in the right direction. – Ben Kronk Feb 21 '17 at 13:04

0 Answers0