[R] rpart$where and predict.rpart

Chua Siang Li siang.li.chua at acceval-intl.com
Tue Jul 22 11:44:58 CEST 2008


   Hello there.  I have fitted a rpart model.
   > rpartModel <- rpart(y~., data=data.frame(y=y,x=x),method="class", ....)
   and  can  use  rpart$where  to  find  out the terminal nodes that each
   observations belongs.
   Now, I have a set of new data and used predict.rpart which seems to give
   only the predicted value with no information similar to rpart$where.
   May I know how to find out the terminal nodes that each new observations
   belongs to?
   Many thanks.
   ----
   Chua Siang Li
   Consultant - Operations Research
   Acceval Pte Ltd
   Tel: 6297 8740
   Email: siang.li.chua at acceval-intl.com
   Website: www.acceval-intl.com
   This message and any attachments (the "message"...{{dropped:12}}


More information about the R-help mailing list