This creates labels for quantile based bins in percent. This assumes the right-closed
intervals as produced by cut_quantile_bins()
.
Arguments
- probs
(
proportion
vector)
the probabilities identifying the quantiles. This is a sorted vector of uniqueproportion
values, i.e. between 0 and 1, where the boundaries 0 and 1 must not be included.- digits
(
integer
)
number of decimal places to round the percent numbers.
Examples
# Internal function - bins_percent_labels
if (FALSE) {
# Just pass the internal probability bounds, then 0 and 100% will be added automatically.
bins_percent_labels(c(0.2, 0.5))
# Determine how to round.
bins_percent_labels(0.35224, digits = 1)
# Passing an empty vector just gives a single bin 0-100%.
bins_percent_labels(c(0, 1))
}