draw.tree | R Documentation |
Graph a classification or regression tree with a hierarchical tree diagram, optionally including colored symbols at leaves and additional info at intermediate nodes.
draw.tree (tree, cex=par("cex"), pch=par("pch"), size=2.5*cex, col=NULL, nodeinfo=FALSE, units="", cases="obs", digits=getOption("digits"), print.levels=TRUE, new=TRUE)
tree |
object of class |
cex |
size of text, par parameter. |
pch |
shape of symbol at leaves, par parameter. |
size |
if |
col |
vector of colors from |
nodeinfo |
if |
units |
label for units of mean value of response, if regression tree. |
cases |
label for type of observations. |
digits |
number of digits to round mean value of response, if regression tree. |
print.levels |
if |
new |
if |
As in plot.rpart(,uniform=TRUE)
, each level has constant depth.
Specifying nodeinfo=TRUE
, shows the deviance explained or the
classification rate at each node.
A split is shown, for numerical variables, as
variable <> value
when the cases with lower values go left, or as
variable >< value
when the cases with lower values go right.
When the splitting variable is a factor, and print.levels=TRUE,
the split is shown as levels = factor = levels
with the cases
on the left having factor levels equal to those on the left of the
factor name, and correspondingly for the right.
The vector of colors supplied or generated.
Denis White
rpart
,
draw.clust
,
map.groups
library (rpart) data (oregon.env.vars) draw.tree (clip.rpart (rpart (oregon.env.vars), best=7), nodeinfo=TRUE, units="species", cases="cells", digits=0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.