match_near | R Documentation |
match_near
is similar to the base function
match
except match_near
returns a vector of
values or positions from y
that are closest to the the vector of
values in x
. If two values in vectory
are equally close to the
value in x
the first one is used.
match_near(x, y, tolerance = Inf, value = TRUE)
x |
Numeric vector of the values to be matched. |
y |
Numeric vector of the values to be matched against |
tolerance |
The maximum numeric difference between values in |
value |
If TRUE, return the value of |
The closest match in y
to a given value in x
is determined
by the the value that has the minimum absolute difference between x
and y
. e.g. which.min(abs(x - y))
vector of values or positions from y
that are closest to the
values in vector x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.