Description Usage Arguments Value Examples
View source: R/plotting_numerical_buckets.R
This function takes a numeric vector var_to_band
and groups it into buckets which are useful for plotting.
These groups have approximately equal weight
Outliers are excluded/included using the include_outliers
option.
This function is built on prep_num_bin
1 2 3 4 5 6 | plotting_numerical_buckets(
var_to_band,
n_bins = 25,
weight = NULL,
include_outliers = FALSE
)
|
var_to_band |
Vector[numeric] - vector of values to be binned |
n_bins |
numeric - Number of bins to split exposure into |
weight |
numeric - vector weight for observations |
include_outliers |
logical - should outliers be trimmed |
data.frame with columns
bin [numeric]: numeric label of bin
labels [character]: string output from prep_num_bin
if called
lower [numeric]: Min bound of the bin
upper [numeric]: Max bound of the bin
center [numeric] : Center of the bin - (upper + lower) / 2
width [numeric] : Width of the bin - (upper - lower)
1 | plotting_numerical_buckets(var_to_band=runif(100), n_bins=10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.