nnear: finds the nearest values in a vector to a specified target...

Description Usage Arguments Details Value

Description

nnear(vect, target, n=1)

Usage

1
nnear(vect, target, n = 1)

Arguments

vect

vector of numerical values

target

target value which you want the nearest values to

n

the n nearest values to return

Details

a simple utility for finding the nearest values in a vector to a specified target value. The values, their position in the vector and the distance between each and the target are returned as a list.

Value

index position of the nearest n values within the original vector

values actual values of the nearest n values

distance absolute distance between the returned values and the target


helophilus/ColsTools documentation built on May 30, 2019, 4:03 p.m.