View source: R/nearest_neighbors.R
search_nn_matrix | R Documentation |
Make a nearest neighbors index using the subject matrix and search it for nearest neighbors to the query_matrix.
search_nn_matrix(
subject_matrix,
query_matrix,
k = 25,
nn_control = list(),
verbose = FALSE
)
subject_matrix |
a matrix used to build a nearest neighbor index. |
query_matrix |
a matrix used to search the subject_matrix nearest neighbor index. |
k |
an integer for the number of nearest neighbors to return for each cell. Default is 25. |
nn_control |
a list of parameters used to make and search the nearest neighbor index. See the set_nn_control help for details. |
verbose |
a boolean indicating whether to emit verbose output. |
a list list(nn.idx, nn.dists) where nn.idx is a matrix of nearest neighbor indices and nn.dists is a matrix of the distance between the index given by the row number and the index given in nn.idx. If the query_matrix is the same as the subject matrix, the index given by the row number should be in the row, usually in the first column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.