Calculate hexagonal nearest neighbors.
HnnNeighbor(dist.hnn, k, include.self = TRUE)
A hexagonal nearest neighbor distance matrix.
Number of neighbors.
Whether to include self as 1st neighbor, default is TRUE
.
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)