I'm working on a Windows 7 machine with R 3.1.0. I downloaded rcaller 2.2 and the latest 2.3 and followed the example of Sequential Commands in the tutorial. However, the program does not stop in Eclipse after the last line of code is executed.
The R.exe and Rterm.exe are still in the task manager. And every time I re-run the program, another R.exe and Rterm.exe are added in the task manager...
The following is the Java code:
import rcaller.RCaller;
import rcaller.RCode;
public class RCallerOnlineTest {
public static void main(String[] args) {
RCaller caller = new RCaller();
// change to your path please
caller.setRExecutable("C:/R/R-3.1.0/bin/x64/R.exe");
RCode code = new RCode();
caller.setRCode(code);
code.addDoubleArray("x", new double[]{1.0, 2.0, 3.0, 4.0, 50.0});
code.addRCode("result <- mean(x)");
caller.runAndReturnResultOnline("result");
double mean = caller.getParser().getAsDoubleArray("result")[0];
System.out.println("mean: " + mean);
boolean status = caller.stopStreamConsumers();
System.out.println(status);
}
}
The output is the following:
mean: 12.0
true
So the last print out true. I assume that it indicates rcaller is stopped, but it's not. Am I missing something here? I couldn't find a method called stop in the library...