[R] JRI problem with R 2.6.1
Vladmir Makarov
vmakarov at pace.edu
Thu Jan 24 19:46:54 CET 2008
Hello Members,
I wonder if someone also having a problem with JRI using new R 2.6.1.
To illustrate the problem, there is a simple Java driver problem
below. The program runs just fine on the other computer with R 2.5.1,
but does not run with R 2.6.1. It gives me no error messages either.
Needles to say, I have jri.dll at the classpath. Also, I have
downloaded the rJava package from R program (packages >> install
packages >> rJava), so version must be correct.
Any suggestions are highly appreciated,
Thanks,
Vlad
import org.rosuda.JRI.Rengine;
public class Driver {
public static void main(String[] args){
try {
String[] arg = {};
Rengine re = new Rengine(arg, false, null);
if (!Rengine.versionCheck()) {
Rengine.getVersion();
System.err.println("** Version mismatch");
System.exit(1);
}
if (!re.waitForR()) {
System.out.println("** Cannot load R");
System.exit(1);
}
double d = re.eval("3+5").asDouble();
System.out.print("D = " + d);
} catch (RuntimeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
More information about the R-help
mailing list