Skip to content
Prev 385466 / 398506 Next

how to create a sequence to consecutive values

Using ?rle
< rep(v,z$lengths)
 [1] 0 0 0 1 1 1 1 0 0 0 0 2 2 0 3 3 3 0 0

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Fri, Aug 28, 2020 at 7:52 AM Stefano Sofia <
stefano.sofia at regione.marche.it> wrote: