0

我正在尝试在 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);
4

1 回答 1

2

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

参考 rcaller-calling-r-from-java

于 2015-04-28T11:34:15.943 回答