## S3 method for class 'rpart':
text(x, splits=TRUE, label="yval", FUN=text, all=FALSE,
pretty=NULL, digits=getOption("digits") - 3, use.n=FALSE,
fancy=FALSE, fwidth=0.8, fheight=0.8, ...)
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.TRUE
(default), then the splits in the tree are
labeled with the criterion for the split.x$frame
; values of this
will label the nodes. For the "class"
method,
label="yval"
results in the factor levels
being used, "yprob"
results in the probability of the winning factor
levtext
.TRUE
, all nodes are labeled, otherwise just
terminal nodes.NULL
, the default, signifies using elements of letters to represent
the different factor levels.TRUE
(default), adds to label
(#events level1/ #events level2/etc. for class
,
n
for anova
, and #events/n for poisson
and exp
).TRUE
, nodes are represented by ellipses (interior nodes)
and rectangles (leaves) and labeled by yval
. The edges connecting the
nodes are labeled by left and right splits.fancy
and the width of the ellipses and rectangles.
If fwidth < 1
then it is a scaling factor (default = 0.8). If
fwidth > 1
then it representes the number of character widths
(for current fancy
and the height of the ellipses and rectangles.
If fheight <1< code=""> then it is a scaling factor (default = 0.8). If
fheight > 1
then it represents the number of character heights
(for current1<>
par
).text
, plot.rpart
, rpart
,
post.rpart
, abbreviate
data(freeny)
freen.tr <- rpart(y ~ ., freeny)
plot(freen.tr)
text(freen.tr, use.n=TRUE, all=TRUE)
Run the code above in your browser using DataLab