kNN(x, k, sort = TRUE, search = "kdtree", bucketSize = 10,
splitRule = "suggest", approx = 0)
bucketSize
and splitRule
influence how the kd-tree is built.
approx
uses the approximate nearest neighbor search implemented in ANN.
All nearest neighbors up to a distance of eps
/(1+approx
)
will be considered and all with a distance greater than eps
will not
be considered. The other points might be considered. Note that this results in
some actual nearest neighbors being omitted leading to spurious clusters and noise points. However, the algorithm will enjoy a significant speedup. For more details see Mount and Arya (2010).
frNN
for fixed radius nearest neighbors.