powered by
Compute bins for discretization of numeric variable (either equal_width or equal_fred).
build_bins( data_set, cols = "auto", n_bins = 10, type = "equal_width", verbose = TRUE )
A list where each element name is a column name of data set and each element contains bins to discretize this column.
Matrix, data.frame or data.table
List of numeric column(s) name(s) of data_set to transform. To transform all characters, set it to "auto". (character, default to "auto")
Number of group to compute (numeric, default to 10)
Type of discretization ("equal_width" or "equal_freq")
Should the algorithm talk? (Logical, default to TRUE)
Using equal freq first bin will start at -Inf and last bin will end at +Inf.
# Load data data(tiny_messy_adult) head(tiny_messy_adult) # Compute bins bins <- build_bins(tiny_messy_adult, cols = "auto", n_bins = 5, type = "equal_freq") print(bins)
Run the code above in your browser using DataLab