which_nearest | R Documentation |
Used internally, to find the index of the value in a vector nearest to a target value, possibly in a specific preferred direction.
which_nearest(values, target, dir)
values |
numeric vector, the values considered. |
target |
single numeric value, the target to find the value closest to. |
dir |
single numeric value. If |
Single integer, the index of the value closest to target
according
to dir
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.