Re: [R] counting repeating sequence lengths in a vector

2010-02-22 Thread Henrique Dallazuanna
Try this: rle(x)$length On Mon, Feb 22, 2010 at 2:27 PM, Larson, TR wrote: > Hello, > I have a very long (~50,000) sequence of repeating numbers.  The first 100 > are: > > [1]     0     0     0     0     0     0     0     0     0     0     0   429 >  [13]   429   429   429   429   429   429   4

[R] counting repeating sequence lengths in a vector

2010-02-22 Thread Larson, TR
Hello, I have a very long (~50,000) sequence of repeating numbers. The first 100 are: [1] 0 0 0 0 0 0 0 0 0 0 0 429 [13] 429 429 429 429 429 429 429 858 858 858 858 858 [25] 858 1287 1287 1287 1287 1287 1716 2145