0
我嘗試啓動RCaller,但我在開始的時候會失敗。
當我嘗試運行任何示例中,線入門RCaller 3.1
RCaller caller = RCaller.create();
給出以下例外:
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
我想原因是,在Globals.java,存在用於定義R路徑,這不適合我的安裝。如果這是正確的,問題就變成:
我怎麼能告訴RCaller在安裝我的R'
我知道,在早期版本的RCaller的,像
caller.setRScriptExecutable(String path);
caller.setRExecutable(String path);
存在,但這個命令不工作了。
我也嘗試手動更改Globals.java,改變
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";
到
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";
,但是這不可能是正確的解決方案,它不反正工作。
有誰知道一個妥善的解決辦法?