I am trying to use match()in R to find suitable values for a specific interval. For instance:
v <- c(2.2, 2.4, 4.3, 1.3, 4.5, 6.8, 0.9)
match(2.4, v)
gives me all the places where 2.4 is found in v, but what if I wanted to give a range for all possible matches? For example, 2.4 +/- 0.2?
Any help is greatly appreciated, thanks in advance!
source
share