
Last chance! 50% off unlimited learning
Sale ends in
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)
a numeric vector with
a list with two elements: vector of run lengths, and another list of values corresponding to generated sequences' lengths.
See original thread for more details http://stackoverflow.com/a/8467446/457898. Special thanks to Gabor Grothendieck for this one!