jrmycohen / rcaller

Automatically exported from code.google.com/p/rcaller
Other
0 stars 0 forks source link

Can not handle R results due to : rcaller.exception.RCallerParseException: Can not parse the R output: org.xml.sax.SAXParseException: Premature end of file #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

caller.addDoubleArray("x", x);
caller.addDoubleArray("y", y);
caller.addRCode("ols<-lm(y~x)");
caller.runAndReturnResult("ols");

What is the expected output? What do you see instead?
Throws exception defined in the subject.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by mhsatman on 22 Jul 2011 at 8:10

GoogleCodeExporter commented 8 years ago
Hi,

I am using R-3.1.2 in my windows 7.
I have included RCaller-2.4-SNAPSHOT.jar in my web project and calling the 
below code.i am getting exception as Can not handle R results due to : 
rcaller.exception.RCallerParseException: Can not parse the R output: 
org.xml.sax.SAXParseException: Premature end of file.
I have installed Runiversal package as well.

RCaller caller=new RCaller();

                                            caller.setRscriptExecutable("C:/Program Files/R/R-3.1.2/bin/Rscript");
RCode code1 = new RCode();
StringBuffer code=new StringBuffer();
code.append("x<-rnorm(10);");
code.append("y<-rnorm(10);");
code.append("ols<-lm(y~x);");
code.append("s<-summary(ols);");

code1.setCode(code);
caller.runAndReturnResult(code1.toString());
String[] fields=caller.getParser().getAsStringArray("s");

Original comment by krish.bh...@gmail.com on 20 Jan 2015 at 11:39

GoogleCodeExporter commented 8 years ago
There is no such field as 's' in object ols.

Try

[] fields=caller.getParser().getAsX("residuals");

or 

[] fields=caller.getParser().getAsX("fitted.values");

or a field name which is a member of object ols.

Original comment by mhsatman on 20 Jan 2015 at 11:47

GoogleCodeExporter commented 8 years ago
can any one tell me how to install RCaller in java eclipse in windows 7...???

need full detailed guidance .......

Original comment by kaj...@gmail.com on 23 May 2015 at 5:00