[R] Counting the number of integers at one swoop

Carl Witthoft carl at witthoft.com
Fri Oct 14 21:38:41 CEST 2011


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


-- 
-----
Sent from my Cray XK6



More information about the R-help mailing list