# stem.leaf

From Rcmdr v1.3-6
by John Fox

##### Stem-and-Leaf Display

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

- Keywords
- misc

##### 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)
## S3 method for class 'stem.leaf':
print(x, ...)
```

##### Arguments

- 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.). - x
- an object of class stem.leaf to be printed.
- ...
- not used: for compatibility with the generic print function.

##### 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*.
Outliers are determined using the rule for boxplots (see `boxplot.stats`

).

##### Value

- Returns on object of class stem.leaf, which normally would be printed.

##### References

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

##### See Also

##### Examples

```
data(Prestige)
stem.leaf(Prestige$income)
```

*Documentation reproduced from package Rcmdr, version 1.3-6, License: GPL version 2 or newer*

### Community examples

Looks like there are no examples yet.