Description Usage Arguments Value Examples
View source: R/which_closest.R
Used to find the index of the element of a vector x
with the value
closest to y
, regardless of whether it is greater or less than y
.
1 | which_closest(x, y)
|
x |
A numeric vector with length > 1 from which to find an element index. |
y |
A numeric vector with length == 1, the "close to" value. |
a numeric vector with length 1, which represents the index of x
that is closest to the value y
.
1 | which_closest(x = 5:10, y = 7)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.