Not able to comprehend on the divison of no.s into its bin in this sample set. Here, based on nbins= #units, the result is different.

And the arrangement is so confusing (see pic). What is the logic behind this binning or splitting of elements as per r for the cases below ?

(e.g. input vector )

library(infotheo)
x <- c(5,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,9,10,11,11,20,21,22)
x0<-discretize(x,disc="equalfreq", nbins=4)
x1<-discretize(x,disc="equalfreq", nbins=2)
x2<-discretize(x,disc="equalfreq")

equal frequency binning

0 Answers