
Last chance! 50% off unlimited learning
Sale ends in
Creates a classical ("Tukey-style") stem and leaf display / back-to-back 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, 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)
a numeric vector of data
first dataset for stem.leaf.backback
first dataset for stem.leaf.backback
leaf unit, as a power of 10 (e.g., 100
, .01
);
if unit
is missing unit
is choosen by stem.leaf
.
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
.
smallest non-outlying value; omit for automatic choice.
largest non-outlying value; omit for automatic choice.
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"
.
"Tukey"
(the default) for "Tukey-style" divided stems;
"bare"
for divided stems that simply repeat the stem digits.
if TRUE
(the default), outliers are placed on LO
and
HI
stems.
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.
if TRUE
(the default), reverse direction the leaves on negative
stems (so, e.g., the leaf 9 comes before the leaf 8, etc.).
if TRUE "NA" values are removed otherwise the number of NAs are counted.
if TRUE output of the stem and leaf display by cat
.
if TRUE no depths are printed.
number of blanks that are added besides the leaves.
if FALSE two parallel stem and leaf displays are constructed.
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).
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.
Tukey, J. Exploratory Data Analysis. Addison-Wesley, 1977.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab