HnnNeighbor | R Documentation |
Calculate hexagonal nearest neighbors.
HnnNeighbor(dist.hnn, k, include.self = TRUE)
dist.hnn |
A hexagonal nearest neighbor distance matrix. |
k |
Number of neighbors. |
include.self |
Whether to include self as 1st neighbor, default is |
A list containing the following:
knn.idx, an n x k matrix for the nearest neighbor indice.
knn.dist, an n x k matrix for the nearest neighbor hexagonal distances.
dist.mat, a connectivity-based distance matrix.
Middleton, L. & Sivaswamy, J. Edge detection in a hexagonal-image processing framework. Image Vis. Comput. 19, 1071–1081 (2001)
{ data.use <- quakes[1:100,] dist.use <- as.matrix(dist(data.use[,1:2])) res <- HnnNeighbor(dist.use, k = 10) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.