gpt4 book ai didi

java - RCaller 3.1 入门

转载 作者:行者123 更新时间:2023-12-01 09:08:58 40 4
gpt4 key购买 nike

我尝试从 RCaller 开始,但一开始就失败了。
当我尝试运行任何示例时,该行

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";

但这不可能是正确的解决方案,而且无论如何它都不起作用。
有谁知道正确的解决方案吗?

最佳答案

RCaller 已更新以解决该问题

关于java - RCaller 3.1 入门,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41042312/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com