Re: [R] rpart$where and predict.rpart

From: Chua Siang Li <>
Date: Wed, 23 Jul 2008 11:09:23 +0800

   Brian, thanks for the prompt reply.
   I am quite new to R and have no clue on how to call internal function.    Tried the following but failed:
> .Internal("pred.rpart")

   Error in .Internal("pred.rpart") : invalid .Internal() argument
> .Internal()

   Error in .Internal() : 0 arguments passed to '.Internal' which requires 1
> .Primitive("pred.rpart")

   Error in .Primitive("pred.rpart") : no such primitive function
> .Primitive("rpart-internal")

   Error in .Primitive("rpart-internal") : no such primitive function    So, I copy the whole source code into my codes    pred.rpart <- function(fit, x) {

       frame <- fit$frame
       nc <- frame[, c('ncompete', 'nsurrogate')]
   but still have error msg:
   > where <- pred.rpart(mod, newdata=as.matrix(xLost))    Error in pred.rpart(mod, newdata = as.matrix(xLost)) :      unused argument(s) (newdata = c("1335.0", "1335.0", "1335.0", "1335.0",    .....
   Btw, my predict function is ok.
   > predictLost <- predict(mod, newdata=data.frame(y=yLost, x=xLost))    Thanks.

   Chua Siang Li
   Consultant - Operations Research
   Acceval Pte Ltd
   Tel: 6297 8740
   Email:    Website:
   This message and any attachments (the "message") are intended for the    designated recipient only and may contain information that is confidential    and privileged. If you are not the intended recipient, please notify the    sender and delete all its contents. Any use , reliance on, reference to,    review , disclosure or copying of the message and the information it    contains is prohibited.


  4. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Wed 23 Jul 2008 - 03:14:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 03:32:35 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive