gpt4 book ai didi

java - rCaller 生成一个空图像和空图

转载 作者:行者123 更新时间:2023-12-02 05:28:52 26 4
gpt4 key购买 nike

我正在尝试在 Windows 8、JRE 7、RCaller 2.4 和 R-3.0.2 上运行的 Eclipse 中的示例。我也试过R-3.1.1。但是当生成图时,它显示为空,并且没有显示任何异常或错误。当我查找生成的图时,它的大小为 0 kb。

我在我的 mac-os 上尝试了相同的代码,一切都很完美......

代码:

  RCaller caller = new RCaller();
caller.setRscriptExecutable("C:\\Programme\\R\\R-3.0.2\\bin\\Rscript.exe");

RCode code = new RCode();
code.clear();

// double[] numbers = new double[]{1, 4, 3, 5, 6, 10};
//
// code.addDoubleArray("x", numbers);
File file;
file = code.startPlot();
System.out.println("Plot will be saved to : " + file);
code.addRCode("x<-c(1,4,3,5,6,10)");
code.addRCode("plot(x)");
code.endPlot();

caller.setRCode(code);
caller.runOnly();
code.showPlot(file);

最佳答案

确保您使用的是 RCaller-2.0.7.jar 或高于此的版本。

引用 rcaller-calling-r-from-java

关于java - rCaller 生成一个空图像和空图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25741473/

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