tabulate(bin, nbins = max(bin))
tabulate(cut(lottery.payoff,10),10) x <- c(1,2,3,4,5,5,6,6,7,8) tabulate(x) [1] 1 1 1 1 2 2 1 tabulate(x,15) [1] 1 1 1 1 2 2 1 1 0 0 0 0 0 0 0
x <- c(1,2,3,4,5,5,6,6,7,8) tabulate(x) [1] 1 1 1 1 2 2 1
tabulate(x,15) [1] 1 1 1 1 2 2 1 1 0 0 0 0 0 0 0