ntiles: Create vector based on roughly equally sized groups
Description
Create vector based on roughly equally sized groups
Usage
ntiles(
x,
n = 3,
format = c("rank", "interval", "mean", "median", "center", "left", "right"),
digits = 3
)
Value
a vector. The type of vector will depend on format.
Arguments
x
a numeric vector
n
(approximate) number of quantiles
format
a specification of desired output format. One of
"center", "interval", "left", "right", "mean", or "median.
digits
desired number of digits for labeling of factors.
Details
This is a functional clone of mosaic::ntiles in order to avoid the dependency. It should be
removed in the future, when there is no need to avoid such dependency, e.g. when {mosaic} is
available on WASM.