grouped_stem: Create a Grouped Stem-and-Leaf Plot

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/grouped_stem.R

Description

Create a stem-and-leaf plot where the stems can be grouped by multiple values and the leaves indicate where the values are split

Usage

1
2
3
4
grouped_stem(invec, n = 2)

## S3 method for class 'grouped_stem'
print(x, ...)

Arguments

invec

The input vector. This function only works with integers.

n

The number of stem values to be grouped

x

The object to be printed.

...

Not used.

Value

A list printed with stem-and-leaf formatting

Author(s)

Ananda Mahto

References

https://stackoverflow.com/q/62044245/1270695

See Also

graphics::stem()

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)
data_pos <- sample(0:50, 100, TRUE)
grouped_stem(data_pos, 2)

data_neg <- sample(-50:-1, 100, TRUE)
grouped_stem(data_neg, 2)

data_pos_neg <- c(0, sample(-50:50, 100, TRUE))
grouped_stem(data_pos_neg, 3)

mrdwab/SOfun documentation built on June 20, 2020, 6:15 p.m.