powered by
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.
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<U+2013>1081 (2001)
# NOT RUN { { data.use <- quakes[1:100,] dist.use <- as.matrix(dist(data.use[,1:2])) res <- HnnNeighbor(dist.use, k = 10) } # }
Run the code above in your browser using DataLab