rpart.predict {rpart.plot} | R Documentation |
Extended version of predict.rpart
Description
Identical to predict.rpart
but
optionally show the node numbers and rules for the predicted values.
Usage
rpart.predict(object, newdata,
type = c("vector", "prob", "class", "matrix"),
na.action = na.pass,
nn=FALSE, rules=FALSE, ...)
Arguments
object , newdata , type , na.action |
Identical to the same arguments for |
nn |
If |
rules |
If |
... |
Passed on to |
Value
Same as predict.rpart
,
but with additional information if nn=TRUE
and/or rules=TRUE
.
See Also
Examples
data(ptitanic)
model <- rpart(survived ~ ., data = ptitanic, cp = .02)
head(rpart.predict(model, rules=TRUE))
[Package rpart.plot version 3.1.2 Index]