Skip to content
Prev 387610 / 398502 Next

local maxima positions in a vector with duplicated values

WARNING: I have not carefully tested the following, so you will need to do
so before using.

Like Bill, I found rle a clearer approach. Here's my (not so elegant,
probably) version:
[1]  4  9 12 16
[1]  8 10 13

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, Mar 26, 2021 at 8:36 AM Stefano Sofia <
stefano.sofia at regione.marche.it> wrote: