Plot a Tree Object

DESCRIPTION:

Plots a tree object on the current graphics device.

USAGE:

plot.tree(x, type="", ...)

REQUIRED ARGUMENTS:

x
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:

type=
if "u", uniform spacing of nodes is used; default is nonuniform spacing based on change of deviance of parent and children nodes.
Graphical parameters may also be supplied as arguments to this function (see ).

VALUE:

the coordinates of the nodes in x are returned invisibly as a list with components x and y.

SIDE EFFECTS:

a plot containing an unlabeled dendrogram of the tree object x is produced on the current graphics device.

DETAILS:

This function is a method for the generic function for class tree. It can be invoked by calling for an object x of the appropriate class, or directly by calling regardless of the class of the object.

SEE ALSO:

, , .

EXAMPLES:

zauto <- tree(Mileage ~ Weight + Disp., car.test.frame)
plot(zauto)  # plot on current graphics device
text(zauto) #  put some labels on the plot
identify(zauto) #  find out what car is where by clicking on plot