Learn R Programming

RcppAnnoy: Rcpp bindings for Annoy

What is Annoy?

Annoy is a small, fast and lightweight library for Approximate Nearest Neighbours with a particular focus on efficient memory use and the ability to load a pre-saved index.

Annoy is written by Erik Bernhardsson. See its page for more on features, its (Python) API, and the other language ports. Annoy is part of the esteemed let us find other music you may like algorithm by Spotify.

Why this package?

It provides a nice example for Rcpp Modules and use of templates: Annoy uses a clean C++ core with templated data type, as well as several distance measures. This package shows that it is easy to wrap both aspects from R giving us multi-lingual approaches to data discovery and machine learning.

Status

The package matches the behaviour of the original Python package in the original Python wrapper for the Annoy library. It also replicates all unit tests written for the Python frontend, including a test for efficiently mmap-ing a binary index file.

The package originally built on Linux and OS X, and thanks to a patch by Qiang Kou now also builds on Windows.

Installation

You can either install from source via this repo, or install the CRAN package the usual way from R.

Author

Dirk Eddelbuettel

License

GPL (>= 2)

Copy Link

Version

Install

install.packages('RcppAnnoy')

Monthly Downloads

28,201

Version

0.0.22

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

January 23rd, 2024

Functions in RcppAnnoy (0.0.22)

getArchictectureStatus

Report CPU Architecture and Compiler
RcppAnnoy-package

Rcpp bindings for the Annoy C++ library for approximate nearest neighbors.
getAnnoyVersion

Get the Annoy library version
AnnoyIndex

Approximate Nearest Neighbors with Annoy