I\'m having trouble finding a function in R that performs equal-frequency discretization. I stumbled on the \'infotheo\' package, but after some testing I found that the al
Here's another solution using mltools.
set.seed(1) x <- round(rnorm(20), 2) x.binned <- mltools::bin_data(x, bins = 5, binType = "quantile") table(x.binned) x.binned [-2.21, -0.622) [-0.622, 0.1) [0.1, 0.526) [0.526, 0.844) [0.844, 1.6] 4 4 4 4 4