nearest.neighbours | R Documentation |
This function can be used to generate nearest neighbour information for a set of 2D data points.
nearest.neighbours(x, y)
x |
vector containing |
y |
vector containing |
The C++ implementation of this function is used inside the
locpoly
and interp
functions.
A list with two components
index |
A matrix with one row per data point. Each row contains the indices
of the nearest neigbours to the point associated with this row,
currently the point itself is also listed in the first row, so
this matrix is of dimension |
dist |
A matrix containing the distances according to the neigbours listed
in component |
Albrecht Gebhardt <albrecht.gebhardt@aau.at>, Roger Bivand <roger.bivand@nhh.no>
convex.hull
data(franke)
## use only a small subset
fd <- franke$ds1[1:5,]
nearest.neighbours(fd$x,fd$y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.