summary.rpart: Summarize a Fitted Rpart Object

View source: R/summary.rpart.R

summary.rpartR Documentation

Summarize a Fitted Rpart Object


Returns a detailed listing of a fitted rpart object.


## S3 method for class 'rpart'
summary(object, cp = 0, digits = getOption("digits"), file, ...)



fitted model object of class "rpart". This is assumed to be the result of some function that produces an object with the same named components as that returned by the rpart function.


Number of significant digits to be used in the result.


trim nodes with a complexity of less than cp from the listing.


write the output to a given file name. (Full listings of a tree are often quite long).


arguments to be passed to or from other methods.


This function is a method for the generic function summary for class "rpart". It can be invoked by calling summary for an object of the appropriate class, or directly by calling summary.rpart regardless of the class of the object.

It prints the call, the table shown by printcp, the variable importance (summing to 100) and details for each node (the details depending on the type of tree).

See Also

summary, rpart.object, printcp.


## a regression tree <- rpart(Mileage ~ Weight, car.test.frame)

## a classification tree with multiple variables and surrogate splits.
summary(rpart(Kyphosis ~ Age + Number + Start, data = kyphosis))

rpart documentation built on Oct. 22, 2022, 1:05 a.m.