I have a sequence of numbers that I want to check and reject numbers that do not increase with similar level.
data <- c(1, 2, 5, 6, 6.25, 6.49, 6.75, 7.01, 8, 9, 11)
For example, for the data here I want to subset numbers with an increase of 0.25+/-0.1, and reject numbers that do not follow this rule. In this case, the subseted sequence would be (6, 6.25, 6.49, 6.75, 7.01).
Here's an ugly way to grab the indexes that you want to keep. Change
0.35
if you're interested in a different cutoff valueCall the function to obtain the answer you want with
Another test