Hi,

I would like to be able to count a sequence of numbers. For example, given a
vector of the following integers

(1,1,1,2,2,2,2,3,3,3,3,3,3,1,1,1,1, 3,3)

the function would return

(3, 4, 6, 4,2)

Does anyone have any cool ideas to solve this?

Any help appreciated.

Regards,

Sam.

        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to