DMwR (version 0.4.1)

prettyTree: Visual representation of a tree-based model

Description

This function plots a tree-based model, i.e. a rpart object

Usage

prettyTree(t, compress = F, branch = 0.2, margin = 0.1, uniform = T, all = T, cex = 0.8, font = 10, use.n = T, fwidth = 0.5, fheight = 0.45, center = 0, ...)

Arguments

t
A rpart object
compress
A boolean parameter passed to plot.rpart(). See the help page of this function for further details. Defaults to F.
branch
A numeric parameter passed to plot.rpart(). See the help page of this function for further details. Defaults to 0.2.
margin
A numeric parameter passed to plot.rpart(). See the help page of this function for further details. Defaults to 0.1.

uniform
A boolean parameter passed to plot.rpart(). See the help page of this function for further details. Defaults to T.

all
A boolean parameter passed to text.rpart(). See the help page of this function for further details. Defaults to T.

cex
A number controling the character size. Defaults to 0.8.
font
A number setting the base font size in points. Defaults to 10.
use.n
A boolean parameter passed to text.rpart(). See the help page of this function for further details. Defaults to T.

fwidth
A numeric parameter passed to text.rpart(). See the help page of this function for further details. Defaults to 0.5.

fheight
A numeric parameter passed to text.rpart(). See the help page of this function for further details. Defaults to 0.45.

center
A numeric parameter controlling drawing of ellipses. Defaults to 0.
...
Further parameters passed both to plot.rpart() and text.rpart()

Details

This function achieves the same functionallity as applying the function plot() and then the function text() to a rpart object: it essentially obtains a graphical representation of a tree-based model. The basic differences are related to visual formatting of the trees.

References

Therneau, T. M. and Atkinson, B.; port by Brian Ripley. (2010). rpart: Recursive Partitioning. R package version 3.1-46.

Torgo, L. (2010) Data Mining using R: learning with case studies, CRC Press (ISBN: 9781439810187).

http://www.dcc.fc.up.pt/~ltorgo/DataMiningWithR

See Also

plot.rpart, text.rpart, rpartXse, rpart

Examples

Run this code
data(iris)
tree <- rpartXse(Species ~ ., iris)
## Not run: 
# prettyTree(tree)
# prettyTree(tree,all=F,use.n=F,branch=0)
# ## End(Not run)

Run the code above in your browser using DataLab