stem.leaf {aplpack} | R Documentation |
stem and leaf display and back to back stem and leaf display
Description
Creates a classical ("Tukey-style") stem and leaf display / back-to-back 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, na.rm = FALSE, printresult = TRUE)
stem.leaf.backback(x,y, unit, m, Min, Max, rule.line = c("Dixon", "Velleman",
"Sturges"), style = c("Tukey", "bare"), trim.outliers = TRUE,
depths = TRUE, reverse.negative.leaves = TRUE, na.rm = FALSE,
printresult=TRUE, show.no.depths = FALSE, add.more.blanks = 0,
back.to.back = TRUE)
Arguments
data |
a numeric vector of data |
x |
first dataset for |
y |
first dataset for |
unit |
leaf unit, as a power of 10 (e.g., |
m |
number of parts (1, 2, or 5) into which each stem will be separated;
if |
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; |
style |
|
trim.outliers |
if |
depths |
if |
reverse.negative.leaves |
if |
na.rm |
if TRUE "NA" values are removed otherwise the number of NAs are counted. |
printresult |
if TRUE output of the stem and leaf display by |
show.no.depths |
if TRUE no depths are printed. |
add.more.blanks |
number of blanks that are added besides the leaves. |
back.to.back |
if FALSE two parallel stem and leaf displays are constructed. |
Details
Unlike the stem
function in the base
package, stem.leaf
produces
classic stem-and-leaf displays, as described in Tukey's Exploratory Data Analysis.
The function stem.leaf.backback
creates back-to-back stem and leaf displays.
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), display
(stem and leaf display as character vecter),
lower
(very small values), upper
(very large values), depths
(vector of depths),
stem
(stem information as a vector), and leaves
(vector of leaves).
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
Examples
stem.leaf(co2)
stem.leaf.backback(co2[1:120],co2[121:240])
stem.leaf.backback(co2[1:120],co2[121:240], back.to.back = FALSE)
stem.leaf.backback(co2[1:120],co2[121:240], back.to.back = FALSE,
add.more.blanks = 3, show.no.depths = TRUE)
stem.leaf.backback(rivers[-(1:30)],rivers[1:30], back.to.back = FALSE, unit=10, m=5,
Min=200, Max=900, add.more.blanks = 20, show.no.depths = TRUE)