stem.leaf {Rcmdr} | R Documentation |
Creates a classical ("Tukey-style") stem-and-leaf display.
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, print=TRUE)
data |
a numeric vector. |
unit |
leaf unit, as a power of 10 (e.g., 100 , .01 );
omit to let the function choose the unit. |
m |
number of parts (1, 2, or 5) into which each stem should be divided; omit to let the function choose the number of parts/stem. |
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 the leaves on negative
stems (so, e.g., the leaf 9 comes before the leaf 8, etc.). |
print |
if TRUE (the default), prints the stem-and-leaf display. |
Unlike the stem
function in the base
package, this function produces
classic stem-and-leaf displays, as described in Tukey's Exploratory Data Analysis.
Outliers are determined using the rule for boxplots (see boxplot.stats
).
If print = TRUE
, invisibly returns NULL
; otherwise returns a list with
information for constructing the stem-and-leaf display.
Peter Wolf, slightly modified by John Fox jfox@mcmaster.ca with the original author's permission.
Tukey, J. Exploratory Data Analysis. Addison-Wesley, 1977.
data(Prestige) stem.leaf(Prestige$income)