View source: R/augment-rpart.R
augment.rpart | R Documentation |
Augment your model object
## S3 method for class 'rpart'
augment(x, data = NULL, newdata = NULL, ...)
x |
rpart model |
data |
data.frame from the model |
newdata |
new data to use for predictions, residuals, etc. |
... |
extra arguments to pass |
augment.rpart
returns the original data with additional columns:
.fitted
: The fitted value or class.
.resid
: only given when the same data as was used for the model is
provided.
library(rpart)
rpart_fit <- rpart(Sepal.Width ~ ., iris)
augment(rpart_fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.