Description Usage Arguments Details Value Author(s) Examples
nn
determines the nearest neighbors for a set of
observations based on a distance matrix.
1 
d 
A square distance matrix for the coordinates of interest. 
k 
The number of neighbors to return (if

method 
The method of determining the neighbors.
The default is 
self 
A logical indicating whether an observation
is a neighbor with itself. The default is

This function determine nearest neighbors in two ways: 1. number of neighbors or 2. distance.
If method = "c"
, then k
specifies the total
number of neighbors to return for each observation.
If method = "d"
, then k
specifies the maximum
distance for which an observation is considered a
neighbor.
The function returns the neighbors for each observation.
Returns a list with the nearest neighbors of each observation. For each element of the list, the indices order neighbors from nearest to farthest.
Joshua French
1 2 3 4 5 6 7 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.