which_nearest {adaptr} | R Documentation |
Find the index of value nearest to a target value
Description
Used internally, to find the index of the value in a vector nearest to a target value, possibly in a specific preferred direction.
Usage
which_nearest(values, target, dir)
Arguments
values |
numeric vector, the values considered. |
target |
single numeric value, the target to find the value closest to. |
dir |
single numeric value. If |
Value
Single integer, the index of the value closest to target
according
to dir
.
[Package adaptr version 1.4.0 Index]