Learn R Programming

The rpart package

This is the source code for the rpart package, which is a recommended package in R. It gets posted to the comprehensive R archive (CRAN) as needed after undergoing a thorough testing.

Overview

The rpart code builds classification or regression models of a very general structure using a two stage procedure; the resulting models can be represented as binary trees. The package implements many of the ideas found in the CART (Classification and Regression Trees) book and programs of Breiman, Friedman, Olshen and Stone. Because CART is the trademarked name of a particular software implementation of these ideas and tree was used for the Splus routines of Clark and Pregibon, a different acronym - Recursive PARTitioning or rpart - was chosen.

Copy Link

Version

Install

install.packages('rpart')

Monthly Downloads

59,060

Version

4.1.24

License

GPL-2 | GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Beth Atkinson

Last Published

January 7th, 2025

Functions in rpart (4.1.24)

car.test.frame

Automobile Data from 'Consumer Reports' 1990
rsq.rpart

Plots the Approximate R-Square for the Different Splits
post.rpart

PostScript Presentation Plot of an Rpart Object
cu.summary

Automobile Data from 'Consumer Reports' 1990
rpart.object

Recursive Partitioning and Regression Trees Object
kyphosis

Data on Children who have had Corrective Spinal Surgery
car90

Automobile Data from 'Consumer Reports' 1990
print.rpart

Print an Rpart Object
printcp

Displays CP table for Fitted Rpart Object
rpart-internal

Internal Functions
xpred.rpart

Return Cross-Validated Predictions
rpart

Recursive Partitioning and Regression Trees
text.rpart

Place Text on a Dendrogram Plot
plot.rpart

Plot an Rpart Object
predict.rpart

Predictions from a Fitted Rpart Object
rpart.control

Control for Rpart Fits
rpart.exp

Initialization function for exponential fitting
snip.rpart

Snip Subtrees of an Rpart Object
plotcp

Plot a Complexity Parameter Table for an Rpart Fit
solder.balance

Soldering of Components on Printed-Circuit Boards
stagec

Stage C Prostate Cancer
prune.rpart

Cost-complexity Pruning of an Rpart Object
summary.rpart

Summarize a Fitted Rpart Object
residuals.rpart

Residuals From a Fitted Rpart Object
meanvar.rpart

Mean-Variance Plot for an Rpart Object
labels.rpart

Create Split Labels For an Rpart Object
path.rpart

Follow Paths to Selected Nodes of an Rpart Object
na.rpart

Handles Missing Values in an Rpart Object