PostScript Presentation Plot of a Tree Object

DESCRIPTION:

Generates a PostScript presentation plot of a tree object.

USAGE:

post.tree(tree, title=deparse(substitute(tree)),
          file=paste(title, ".ps", sep = ""),
          digits=.Options$digits - 3, pretty=0, pointsize=12)

REQUIRED ARGUMENTS:

tree
a fitted model object of class tree. This is assumed to be the result of some function that produces an object with the same named components as that returned by the tree function.

OPTIONAL ARGUMENTS:

title
a title which appears at the top of the plot.
digits
number of significant digits to include in numerical data.
pretty
an integer denoting the extent to which factor levels in split labels will be abbreviated. The default (0) signifies no abbreviation. A NULL signifies using elements of letters to represent the different factor levels.
file
a character string for the name of the ASCII file to contain the output. The default is the name of the object given by tree with the suffix .ps appended to it.
pointsize
base size of text, in points (one point = 1/72 inches). If the graphical parameter cex is 1, the text will appear in this size.

SIDE EFFECTS:

a plot of tree in the PostScript page description language is put in the current working directory.

DETAILS:

The plot is different from the dendrogram produced by plot and is intended for presentation. The edges connecting uniformly spaced nodes are labeled by left and right splits. Nodes are represented by ellipses (interior nodes) and rectangles (leaves) and labeled by yval. Under each node, either the within-node deviance is printed (regression trees) or the misclassification error rate (classification trees). The function is independent of the current graphics device. It creates a file which can be sent directly to a PostScript printer.

SEE ALSO:

, .

EXAMPLES:

z.auto <- tree(Mileage ~ Weight, car.test.frame)
plot(z.auto)  # display tree on active device
# Now construct postscript version on file "pretty"
post.tree(z.auto, file="pretty")

z.hp <- tree(Mileage ~ Weight + HP, car.test.frame)
post.tree(z.hp)

files.in.dir(".")
# Should include the following new files: pretty, z.hp.ps
#endif /*) windows */