buildNNIndex {BiocNeighbors} | R Documentation

## Build a nearest-neighbor index

### Description

Build indices for nearest-neighbor searching with different algorithms.

### Usage

    buildNNIndex(..., BNPARAM=NULL)

### Arguments

`...` | Further arguments to be passed to individual methods. The mandatory argument for all methods is `X`, a numeric matrix where rows correspond to data points and columns correspond to variables (i.e., dimensions).
`BNPARAM` | A BiocNeighborParam object specifying the type of index to be constructed. This defaults to a KmknnParam object if `NULL`.

### Details

Supplying a KmknnParam object as `BNPARAM` will dispatch to `buildKmknn`.

Supplying an AnnoyParam object as `BNPARAM` will dispatch to `buildAnnoy`.

### Value

A BiocNeighborIndex object containing indexing structures for each algorithm.

### Author(s)

Aaron Lun

### See Also

`buildKmknn` and `buildAnnoy` for specific methods.

### Examples

    Y <- matrix(rnorm(100000), ncol=20)
    (k.out <- buildNNIndex(Y))
    (a.out <- buildNNIndex(Y, BNPARAM=AnnoyParam()))

[Package BiocNeighbors version 1.0.0 Index]