packing {donutsk} | R Documentation |
Arrange data to distribute small values
Description
Arrange data to distribute small values further apart from each other
Usage
packing(.data, value, level = NULL)
Arguments
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
value |
A .data field which contains values to distribute |
level |
A .data grouping field for distribution |
Value
An object of the same type as .data.
Examples
# Create an example
n <- 20
df <- dplyr::tibble(
lvl1 = sample(LETTERS[1:5], n, TRUE),
lvl2 = sample(LETTERS[6:24], n, TRUE),
value = sample(1:20, n, TRUE)
)
# Arrange all values
packing(df, value)
# Arrange values within values
packing(df, value, lvl1)
[Package donutsk version 0.1.1 Index]