Get bin expression for a data frame.
getBinExpression.Rd
This function divides the values of a specified column in a data frame into n_bins
bins of equal width.
The bin labels are then added as a new column in the data frame.
Arguments
- dtf_coef
A data frame containing the values to be binned.
- n_bins
The number of bins to create.
Examples
dtf <- data.frame(mu_ij = c(10, 20, 30, 15, 25, 35, 40, 5, 12, 22))
dtf_with_bins <- getBinExpression(dtf, n_bins = 3)