stem.leaf {aplpack}R Documentation

Stem-and-Leaf Display

Description

Creates a classical ("Tukey-style") stem-and-leaf display.

Usage

stem.leaf(data, unit, m, Min, Max, rule.line = c("Dixon", "Velleman", "Sturges"),
    style = c("Tukey", "bare"), trim.outliers = TRUE, depths = TRUE,
    reverse.negative.leaves = TRUE)

Arguments

data a numeric vector.
unit leaf unit, as a power of 10 (e.g., 100, .01); if unit is missing unit is choosen by stem.leaf.
m number of parts (1, 2, or 5) into which each stem will be separated; if m is missing the number of parts/stem (m) is choosen by stem.leaf.
Min smallest non-outlying value; omit for automatic choice.
Max largest non-outlying value; omit for automatic choice.
rule.line the rule to use for choosing the desired number of lines in the display; "Dixon" = 10*log10(n); "Velleman" = 2*sqrt(n); "Sturges" = 1 + log2(n); the default is "Dixon".
style "Tukey" (the default) for "Tukey-style" divided stems; "bare" for divided stems that simply repeat the stem digits.
trim.outliers if TRUE (the default), outliers are placed on LO and HI stems.
depths if TRUE (the default), print a column of "depths" to the left of the stems; the depth of the stem containing the median is the stem-count enclosed in parentheses.
reverse.negative.leaves if TRUE (the default), reverse direction the leaves on negative stems (so, e.g., the leaf 9 comes before the leaf 8, etc.).

Details

Unlike the stem function in the base package, this function produces classic stem-and-leaf displays, as described in Tukey's Exploratory Data Analysis.

Value

The computed stem and leaf display is printed out. Invisibly stem.leaf returns the stem and leaf display as a list containing the elements info (legend), stem (display as character vecter), lower (very small values) , and upper (very large values).

Author(s)

Peter Wolf, the code has been slightly modified by John Fox jfox@mcmaster.ca with the original author's permission, help page written by John Fox, the help page has been slightly modified by Peter Wolf.

References

Tukey, J. Exploratory Data Analysis. Addison-Wesley, 1977.

See Also

stem

Examples

stem.leaf(co2)

[Package aplpack version 1.0 Index]