Displaying 1 result from an estimated 1 matches for "search_range".
2007 Jan 30
3
How to find series of small numbers in a big vector?
...index is the
time-order of my measurements, and therefore
cannot be lost.
How do I use R to find the starting and ending
index of ANY and ALL the "series" or "sequences"
in that vector where ever there are 5 or more
members in a row between 0.021 and 0.029 ?
For example:
search_range <- c (0.021, 0.029) # inclusive searching
search_length <- 5 # find ALL series of 5 members within search_range
my_data <- c(0.900, 0.900, 0.900, 0.900, 0.900,
0.900, 0.900, 0.900, 0.900, 0.900,
0.900, 0.028, 0.024, 0.027, 0.023,
0.022, 0.900, 0.900...