Search code examples
javarrcaller

Getting started with RCaller 3.1


I try to start with RCaller, but I fail at the very beginning.
When I try to run any example, the line

RCaller caller = RCaller.create(); 

gives the following Exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.github.rcaller.rstuff.RCallerOptions.create(RCallerOptions.java:32)
    at com.github.rcaller.rstuff.RCaller.create(RCaller.java:83)
    at Test.main(Test.java:8)
Caused by: java.lang.NullPointerException
    at java.util.Arrays.sort(Unknown Source)
    at com.github.rcaller.util.Globals.<clinit>(Globals.java:65)
    ... 3 more

I guess the reason is that in Globals.java, there are paths defined for R, which do not fit my installation. If that's right, the question becomes:
How can I tell RCaller where my R is installed?
I know that in earlier versions of RCaller, something like

caller.setRScriptExecutable( String path );
caller.setRExecutable( String path );  

existed, but this commands don't work anymore.
I also tried to change the Globals.java manually, changing

public static String RScript_Windows = "C:\\Program Files\\R\\R-3.0.2\\bin\\Rscript.exe";
public static String R_Windows = "C:\\Program Files\\R\\R-3.0.2\\bin\\R.exe";

to

public static String RScript_Windows = "E:\\R\\R-3.1.1\\bin\\Rscript.exe";
public static String R_Windows = "E:\\R\\R-3.1.1\\bin\\R.exe";

but this can't be the right solution, and it doesn't work anyway.
Does anyone know a proper solution?


Solution

  • RCaller has been updated to fix the problem