buildIndex | R Documentation |
Build indices for nearest-neighbor searching with different algorithms.
buildIndex(X, transposed = FALSE, ..., BNPARAM = NULL)
X |
A numeric matrix where rows correspond to data points and columns correspond to variables (i.e., dimensions). |
transposed |
Logical scalar indicating whether |
... |
Further arguments to be passed to individual methods. |
BNPARAM |
A BiocNeighborParam object specifying the type of index to be constructed.
If Alternatively, this may be a list returned by |
Each buildIndex
method is expected to return an instance of a BiocNeighborIndex subclass.
The structure of this subclass is arbitrary and left to the discretion of the method developer.
Developers are also responsible for defining methods for their subclass in each of the relevant functions (e.g., findKNN
, queryKNN
).
The exception is if the method returns an instance of a BiocNeighborGenericIndex subclass,
which can be used with the existing methods for findKNN
, etc. without further effort.
A BiocNeighborIndex object can be used in findKNN
and related functions as the X=
argument.
Users should assume that the index is not serializable, i.e., cannot be saved or transferred between processes.
Aaron Lun
Y <- matrix(rnorm(100000), ncol=20)
(k.out <- buildIndex(Y))
(a.out <- buildIndex(Y, BNPARAM=AnnoyParam()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.