Description Usage Arguments Details Value Examples
dist_to_knn
calculates the distance between one point and its kth
nearest neighbor in a vector
1 | dist_to_knn(x, nghDat, k)
|
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. |
These are the details of the function.
The distance between x
and its k
th nearest neighbor in
nghDat
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.