nndist determines the nearest
neighbors for a set of observations within a certain
An n\times n square distance matrix containing the intercentroid distance between the n region centroids.
A proportion in (0, 1]. The distance of
potential clusters must be no more than
This function determines the nearest neighbors of each centroid based on the intercentroid distance. The number of nearest neighbors is limited by the furthest distance between the starting centroid and the farthest neighbor.
Returns the indices of the nearest neighbors as a list.
data(nydf) coords <- as.matrix(nydf[, c("longitude", "latitude")]) d <- as.matrix(dist(coords)) nn <- nndist(d, ubd = 0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.