I like findInterval
for these sorts of tasks:
x <- c(1,2,3,20,21,22,40,41,42,60,61,62,80,81,82)
table(findInterval(x,c(0,20,40,60,80)))
1 2 3 4 5
3 3 3 3 3
4
solved Counting Values in R Vector
I like findInterval
for these sorts of tasks:
x <- c(1,2,3,20,21,22,40,41,42,60,61,62,80,81,82)
table(findInterval(x,c(0,20,40,60,80)))
1 2 3 4 5
3 3 3 3 3
4
solved Counting Values in R Vector