Le 12/05/2010 11:49, Nicolas Dumoulin a écrit :
Hi,
Hi
I'm trying to use j2r with the sensitivity R package http://cran.r-project.org/web/packages/sensitivity/index.html
I've installed R 2.10.1, sensitivity 1.4.0 and Rserve 0.6-1.
Following commands are OK in the R shell: library('sensitivity') fast99(model = NULL,factors=3,n=1000,q='qunif',q.arg=list(min=-1,max=1))
but if I try the same with j2r, I've got: Exception in thread "main" java.lang.NullPointerException at org.nuiton.j2r.net.RNetEngine.convertResult(RNetEngine.java:302) at org.nuiton.j2r.net.RNetEngine.convertResult(RNetEngine.java:293) at org.nuiton.j2r.net.RNetEngine.convertResult(RNetEngine.java:293) at org.nuiton.j2r.net.RNetEngine.convertResult(RNetEngine.java:293) at org.nuiton.j2r.net.RNetEngine.eval(RNetEngine.java:169) at org.nuiton.j2r.RProxy.eval(RProxy.java:154)
My java code is: Engine rengine = new RProxy(); rengine.eval("library('sensitivity')"); rengine.eval("fast99(model = NULL,factors=3,n=1000,q='qunif',q.arg=list(min=-1,max=1))");
If someone have an idea…
Ok, it is trying to convert the result and got a NPE trying to do it. As you do not use the result from R in your code, you could replace the eval() method by the voidEval() one (that do not try to return the result from R and so do not make the conversion). This should make your example work. I'll have a look to the NPE though because it should not happen. Best regards, Jean