search for: unsuccesifuli

Displaying 1 result from an estimated 1 matches for "unsuccesifuli".

Did you mean: unsuccesifuly
2008 May 13
2
Max consecutive increase in sequence
Hi all R helpers, I'm trying to comeup with nice and elegant way of "detecting" consecutive increases/decreases in the sequence of numbers. I'm trying with combination of which() and diff() functions but unsuccesifuly. For example: sq <- c(1, 2, 3, 4, 4, 4, 5, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1); I'd like to find way to calculate a) maximum consecutive increase = 3 (from 1