Skip to content
Prev 274489 / 398506 Next

Counting the number of integers at one swoop

You guys are working too hard.


Rgames> y <- c(0,1,1,3,3,3,5,5,6)
Rgames> rle(sort(y))
Run Length Encoding
   lengths: int [1:5] 1 2 3 2 1
   values : num [1:5] 0 1 3 5 6