Fast Nearest Neighbour Search (Wraps ANN Library) Using L2 Metric

Finds the k nearest neighbours for every point in a given dataset in O(N log N) time using Arya and Mount's ANN library (v1.1.3). There is support for approximate as well as exact searches, fixed radius searches and 'bd' as well as 'kd' trees. The distance is computed using the L2 (Euclidean) metric. Please see package 'RANN.L1' for the same functionality using the L1 (Manhattan, taxicab) metric.


Release Version CRAN_Status_Badge Build Status Downloads

Finds the k nearest neighbours for every point in a given dataset in O(N log N) time using Arya and Mount's ANN library (v1.1.3). There is support for approximate as well as exact searches, fixed radius searches and bd as well as kd trees.

This package implements nearest neighbors for the Euclidean (L2) metric. For the Manhattan (L1) metric, install the RANN1 package.

For further details on the underlying ANN library, see http://www.cs.umd.edu/~mount/ANN.

Installation

Released versions

The recommendation is to install the released version from CRAN by doing:

install.packages("RANN")

Bleeding Edge

You can, however, download the tar ball, and run R CMD INSTALL on it, or use the devtools package to install the development version:

# install.packages("devtools")
 
devtools::install_github("jefferis/RANN")

Note: Windows users need Rtools and devtools to install this way.

Feedback

Please feel free to:

Copyright and License

see inst/COPYRIGHT and DESCRIPTION files for copyright and license information.

News

RANN 2.6.1

  • Fix Solaris compile error (as requested by BDR, #25)
  • Correct usage for compiler vs preprocessor flags (#26)

RANN 2.6.0

  • remove register key word from libANN code (at request of CRAN, #23)

RANN 2.5.1

  • bug fix wrong result dimensions when query is a vector (#17) thanks to github user dayey1
  • bug fix: check query vs data dimensions
  • register native routines (now a NOTE on R 3.4.0)
  • fix CRAN URLs in README

RANN 2.5.0

  • completely remove defunct nn function
  • add note in README about new RANN1 package offering Manhattan (L1) metric as an alternative to Euclidean (L2) metric. Note that RANN1 is only available on github at the time of writing).
  • dev: use ANN_ROOT macro to unsquare distances

RANN 2.4.1

  • fix malformed URL field in DESCRIPTION (K. Hornik)

RANN 2.4.0

  • fix crashing bug when receving N x 0 input matrix (thanks to Rajaraman V for bug report)
  • doc: correct documentation of return type and other clarifications.
  • dev: switch to testthat for tests
  • dev: add Travis CI integration (https://travis-ci.org/jefferis/RANN)
  • dev: add rstudio project, retire StatET Eclipse project

RANN 2.3.0

  • remove nn() function since underlying get_NN() had memory leaks (noticed by Brian Ripley)
  • make nn2() use input data as query when query not specified)
  • add Arya and Mount as authors (in accordance with CRAN policies, again BDR)
  • add Arya, Mount and University of Maryland in Copyright line (in accordance with CRAN policies, again BDR)
  • add COPYRIGHT file to make it clear exactly which files are from the ANN library and therefore subject to that library's copyright.

RANN 2.2.1

  • fix yet more warnings for CRAN due to presence in ANN of exit(), std:cout and std:cerr

RANN 2.2.0

  • no user-visible changes in theory
  • switch to roxygen2 for documentation
  • use this to provide a NAMESPACE as requested for CRAN
  • and switch from deprecated .First.lib to useDynLib

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("RANN")

2.6.1 by Gregory Jefferis, 2 months ago


https://github.com/jefferis/RANN


Report a bug at https://github.com/jefferis/RANN/issues


Browse source code at https://github.com/cran/RANN


Authors: Sunil Arya and David Mount (for ANN) , Samuel E. Kemp , Gregory Jefferis


Documentation:   PDF Manual  


GPL (>= 3) license


Suggests testthat


Imported by EntropyMCMC, ProbitSpatial, RsimMosaic, Seurat, ck37r, evtclass, gjam, insect, ldbod, miceExt, nngeo, spatialEco, unbalanced.

Depended on by BRISC, McSpatial, RWBP, RapidPolygonLookup, StatMatch, celestial, saasCNV, spNNGP.

Suggested by LICORS, adespatial, caret, dimRed, flacco, fscaret, nabor, recipes, spdep.


See at CRAN