[R] rpart error message

Raji raji.sankaran at gmail.com
Tue Apr 3 10:16:35 CEST 2012


Hi R-helpers,
 I am using rpart package for decision tree using R.We are invoking R
environment through JRI from our java application.Hence, the result of R
command is returned in REXP and we use geterrMessage() to retrieve the
error.

When we execute the following command,

cnr_model<-rpart(as.factor(Species)~Sepal Length+Sepal Width+Petal Length,
method="class", parms=list(split="gini",prior=c()),
control=rpart.control(minsplit=2,
na.action=na.pass,cp=0.001,usesurrogate=1,maxsurrogate=2,surrogatestyle=0,maxdepth=20,xval=10))

we get an error message* "Error: unexpected symbol in
"a<-cnr_model<-rpart(as.factor(Species)~Sepal Length""*

The REXP returned in not null and the geterrMessage() call doesnt return an
error message.

But for other errors in R , say "summary(cnr_model)" , REXP returned is null
and we get the following error message from geterrMessage() call.

*Error in summary(cnr_model) : object 'cnr_model' not found*

Is this behavior of showing error message specific to rpart package ? Why is
this difference in the way error message is displayed in rpart package?Can
you please let us know how to retrieve error messages of rpart command
through JRI? 

Thanks in advance.

--
View this message in context: http://r.789695.n4.nabble.com/rpart-error-message-tp4528104p4528104.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list