x <- sample(1:100, 1000, rep=TRUE)
xbin <- binit(x)
plot(xbin$values,xbin$lengths, type = 'h')
# without rounding, will just be grass
x <- rnorm(1000)
xbin <- binit(x,2)
plot(xbin$values,xbin$lengths, type = 'h')
Run the code above in your browser using DataLab