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