adj.rle | R Documentation |
Similar to rle
function, this function detects "runs" of adjacent integers, and displays vector of run lengths and list of corresponding integer sequences.
adj.rle(x)
x |
a numeric vector with |
a list with two elements: vector of run lengths, and another list of values corresponding to generated sequences' lengths.
Gabor Grothendieck <ggrothendieck@gmail.com>
See original thread for more details https://stackoverflow.com/a/8467446/564164. Special thanks to Gabor Grothendieck for this one!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.