Hi all,

I'd like to find how many sets of 1s there are in the following example;

x <- rep(c(1,2,1,3,5), each=5)

I know that there are two sets of 1s, visually. Any function in R that allows me to automate the process?

Thanks.


Muhammad

______________________________________________
R-help@r-project.org 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