Recursive Partitioning and Regression Trees

Recursive partitioning for classification, regression and survival trees. An implementation of most of the functionality of the 1984 book by Breiman, Friedman, Olshen and Stone.

CRAN_STATUS_BADGE Downloads Travis-CI Build Status

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.


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.


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


4.1-15 by Beth Atkinson, 3 years ago,

Report a bug at

Browse source code at

Authors: Terry Therneau [aut] , Beth Atkinson [aut, cre] , Brian Ripley [trl] (producer of the initial R port , maintainer 1999-2017)

Documentation:   PDF Manual  

Task views: Analysis of Ecological and Environmental Data, Machine Learning & Statistical Learning, Multivariate Statistics, Survival Analysis

GPL-2 | GPL-3 license

Depends on graphics, stats, grDevices

Suggests survival

Imported by Biocomb, C443, CADStat, CSMES, CTShiny, CTShiny2, DIscBIO, DMwR2, Dforest, EZtune, FSinR, HMP, Harvest.Tree, Hmisc, JOPS, JOUSBoost, LTRCtrees, LongituRF, MetaClean, MetabolomicsBasics, ModTools, Modeler, NoiseFiltersR, PDtoolkit, PredPsych, RRBoost, RSDA, RaSEn, RecordLinkage, SPOT, SSDM, TSDT, VSURF, aVirtualTwins, alookr, autoBagging, baguette, binst, biomod2, bnclassify, bst, catSplit, ccdf, chemmodlab, citrus, classmap, creditmodel, deepdive, div, ebmc, explore, fastAdaboost, fdm2id, feamiR, featurefinder, flashlight, gamclass, gencve, hybridEnsemble, ibmdbR, ipred, isoboost, landmap, lares, mcboost, mcca, mfe, mikropml, mnj, npcs, partykit, ppsr, pre, predReliability, predictoR, psica, radiant.model, rbooster, regressoR, rminer, rms, rotationForest, semtree, simputation, soilassessment, statip, supclust, synthpop, traineR, varbin, vcrpart, visTree.

Depended on by AntAngioCOOL, DStree, DidacticBoost, GENEAclassify, GPLTR, LongCART, MTPS, MplusTrees, PSAgraphics, REEMtree, SQB, ada, adabag, chemometrics, dtree, gamlss.add, iBST, jlctree, longRPart2, maboost, maptree, metacart, multiPIM, quint, regclass, rpart.LAD, rpart.plot, rpart.utils, rpartScore, spatstat.core, spc4sts, splinetree, stima, treeClust.

Suggested by BatchExperiments, BiodiversityR, CALIBERrfimpute, DAAG, DALEXtra, DoubleML, DriveML, DynTxRegime, FRESA.CAD, FSelector, FSelectorRcpp, GenericML, HSAUR, HSAUR2, HSAUR3, HandTill2001, LocalControl, MachineShop, MatchIt, ModelGood, OpenML, PivotalR, R2HTML, ROSE, StratifiedMedicine, SuperLearner, UBL, arsenal, aslib, aurelius,, bartCause, batchtools, butcher, caTools, candisc, caret, caretEnsemble, catdata, ceterisParibus, classifly, condvis2, crtests, data.tree, dials, dlookr, doParallel, doSNOW, e1071, easyalluvial, embed, evtree, finetune, flacco, fscaret, ggResidpanel, ggdendro, ggplot2, iml, imputeR, klaR, languageR, lulcc, mboost, medflex, memoria, mice, mistat, mlr, mlr3, mlr3benchmark, mlr3filters, mlr3fselect, mlr3hyperband, mlr3pipelines, mlr3proba, mlr3spatial, mlr3spatiotempcv, mlr3tuning, mlr3tuningspaces, mlr3viz, mlrCPO, mlrMBO, mlrintermbo, mosaicModel, mosmafs, naniar, parallelMap, parsnip, partools, pdp, pec, plotmo, pmml, purge, rattle, recipes, riskRegression, scoringTools, sense, shapper, shipunov, sperrorest, stablelearner, stabm, tidyrules, treeheatr, utiml, vetiver, vip, visNetwork.

Enhanced by d3r, dendextend, prediction, sfsmisc.

See at CRAN