Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.tree.sequence

Plot a Tree Sequence


Description

Allows the user to plot a tree sequence.

Usage

## S3 method for class 'tree.sequence'
plot(x, ..., type = "l", ylim = range(x$dev),
    order = c("increasing", "decreasing"))

Arguments

x

object of class tree.sequence. This is assumed to be the result of some function that produces an object with the same named components (size, deviance, k) as that returned by prune.tree.

order

of size on the plot. Use "decreasing" for the natural ordering of k and the amount of pruning. Only the first character is needed.

type, ylim, ...

graphical parameters.

Details

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

Side Effects

Plots deviance or number of misclassifications (or total loss) versus size for a sequence of trees.

Examples

data(cpus, package="MASS")
cpus.ltr <- tree(log(perf) ~ syct + mmin + mmax + cach + chmin + chmax,
                 data = cpus)
plot(prune.tree(cpus.ltr))

tree

Classification and Regression Trees

v1.0-40
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre]
Initial release
2019-03-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.