Skip to content
Prev 315348 / 398503 Next

Code to fetch summary info from vector

Maybe rle can help a little here

rle(b>1)

Run Length Encoding
  lengths: int [1:5] 3 5 5 8 3
  values : logi [1:5] FALSE TRUE FALSE TRUE FALSE

 r<-rle(b>1)

r$lengths[r$values]
[1] 5 8

# started for the maximum but need to go home now, sorry. Will continue tomorrow if noone else finishes it.
groups <- rep(1:length(r$lengths),r$lengths)
On 15.01.2013, at 17:16, Benjamin Gillespie wrote: