View source: R/which.nearest.R
which.nearest | R Documentation |
Find values of one vector that are nearest to values in another vector.
which.nearest(x, y)
x |
vector of values to be compared against. |
y |
vector of values to examine relative to @return For each value in |
Tim Gerrodette tim.gerrodette@noaa.gov
x <- sort(sample(1:100, 20))
y <- sort(sample(min(x):max(x), 5))
i <- which.nearest(x, y)
x
y
x[i]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.