dist_to_knn: Distance to kth nearest neighbor

Description Usage Arguments Details Value Examples

Description

dist_to_knn calculates the distance between one point and its kth nearest neighbor in a vector

Usage

1
dist_to_knn(x, nghDat, k)

Arguments

x

number (univariate) or vector (multivariate) corresponding to the reference point.

nghDat

vector (univariate) or array (multivariate) of numbers corresponding to the neighbors.

k

integer specifying the order of the neighbor.

Details

These are the details of the function.

Value

The distance between x and its kth nearest neighbor in nghDat.

Examples

1
2
dist_to_knn(x = 1.4, nghDat = 0:10, k = 4)
dist_to_knn(x=c(1,2),nghDat=array(1:10,dim=c(2,5)),k=1)

kcucchi/vdke documentation built on May 20, 2019, 8:28 a.m.