AnnoyIndex {BiocNeighbors} | R Documentation

## The AnnoyIndex class

### Description

A class to hold indexing structures for the Annoy algorithm for approximate nearest neighbor identification.

### Usage

    AnnoyIndex(path, dim, NAMES=NULL)

    AnnoyIndex_path(x)

    ## S4 method for signature 'AnnoyIndex'
    show(object)

    ## S4 method for signature 'AnnoyIndex'
    dim(x)

    ## S4 method for signature 'AnnoyIndex'
    dimnames(x)

### Arguments

`path` | A string specifying the path to the index file.
`dim` | An integer vector of length 2, specifying the dimensions of the data used to construct the index.
`NAMES` | A character vector of sample names or `NULL`.
`x, object` | A AnnoyIndex object.

### Details

The AnnoyIndex class holds the indexing structure required to run the KMKNN algorithm. Users should never need to call the constructor explicitly, but should generate instances of AnnoyIndex classes with `buildAnnoy`.

### Value

The `AnnoyIndex` constructor will return an instance of the AnnoyIndex class.

`AnnoyIndex_path` will return the path to the index file.

`dim` will return the dimensions of the data set used to create the index.

`dimnames` will return a list of length 2 where the first element is the supplied `NAMES`.

### Author(s)

Aaron Lun

### See Also

`buildAnnoy`

### Examples

    example(buildAnnoy)

    dim(out)
    str(AnnoyIndex_path(out))

[Package BiocNeighbors version 1.0.0 Index]