augment.rpart: Augment your model object

View source: R/augment-rpart.R

augment.rpartR Documentation

Augment your model object

Description

Augment your model object

Usage

## S3 method for class 'rpart'
augment(x, data = NULL, newdata = NULL, ...)

Arguments

x

rpart model

data

data.frame from the model

newdata

new data to use for predictions, residuals, etc.

...

extra arguments to pass

Value

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.

Examples

library(rpart)
rpart_fit <- rpart(Sepal.Width ~ ., iris)
augment(rpart_fit)

njtierney/broomstick documentation built on Dec. 12, 2023, 5:08 a.m.