powered by
This is a modified version of match() that supports tolerance.
match()
match_within_tolerance(x, table, tolerance = 1e-10)
An integer vector of the same length as x giving the position in table of the first match, or an empty integer vector if table is empty. NA is returned for values in x that have no match.
x
table
NA
(numeric) the values to be matched.
numeric
(numeric) the values to be matched against.
(number) the numerical tolerance for comparison.
number
match_within_tolerance(c(0.1, 0.2, 0.3), c(0.10000001, 0.5, 0.3)) match_within_tolerance(1.5, numeric(0))
Run the code above in your browser using DataLab