[R] Finding sets

Muhammad Rahiz muhammad.rahiz at ouce.ox.ac.uk
Fri Jun 25 11:30:37 CEST 2010


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



More information about the R-help mailing list