Created
February 8, 2012 09:32
-
-
Save rukku/1767181 to your computer and use it in GitHub Desktop.
Finds nearest neighbor between point patterns using FNN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get second nearest neighbors using knnx | |
x1 <- cbind(ponderosa$x, ponderosa$y) | |
x2 <- cbind(rp$x, rp$y) | |
nn2 <- get.knnx(x1, x2, 2) | |
X.2 <- nn2$nn.dist[,2] | |
X.22 <- X.2^2 | |
sumX.22 <- sum(X.22) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment