Print an Rpart Object
Usage
print.rpart(x, pretty=0, spaces=2, cp=0, digits= .Options$digits - 3, ...)
Arguments
x
|
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.
|
pretty
|
a logical or NULL denoting the extent to which factor levels in split
labels will be abbreviated. A value of FALSE signifies no
abbreviation. A NULL signifies using elements of letters to represent
the different factor levels.
|
spaces
|
the number of spaces to indent nodes of increasing depth.
|
digits
|
the number of digits of numbers to print.
|
cp
|
prune all nodes with a complexity less than cp from the printout.
|
Description
This function prints an rpart
object. It is a method for the generic
function print
of class rpart
.Details
This function is a method for the generic function print
for class
"rpart"
. It can be invoked by calling print for an object of the
appropriate class, or directly by calling print.rpart
regardless of
the class of the object.Side Effects
A semi-graphical layout of the contents of x$frame
is
printed. Indentation is used to convey the tree topology.
Information for each node includes the node number, split, size,
deviance, and fitted value. For the "class"
method, yprob
is also
printed.See Also
print
, rpart.object
, summary.rpart
, printcp
Examples
data(car.test.frame)
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
z.auto
node), split, n, deviance, yval
* denotes terminal node
1) root 60 1355.00 24.58
2) Weight>2567.5 45 361.20 22.47
4) Weight>3087.5 22 61.32 20.41 *
5) Weight<3087.5 23 117.70 24.43 *
3) Weight<2567.5 15 186.90 30.93 *