nearest_neighbor_search: Nearest neighbor search

Description Usage Arguments Value

View source: R/search.R

Description

nearest_neighbor_search searches for the k nearest neighbors of a set of query points.

Usage

1
2
nearest_neighbor_search(distances, k, query_indices = NULL,
  search_indices = NULL, radius = NULL)

Arguments

distances

A distances object.

k

The number of neighbors to search for.

query_indices

An integer vector with point indices to query. If NULL, all data points in distances are queried.

search_indices

An integer vector with point indices to search among. If NULL, all data points in distances are searched over.

radius

Restrict the search to a fixed radius around each query. If fewer than k search points exist within this radius, no neighbors are reported (indicated by NA).

Value

A matrix with point indices for the nearest neighbors. Columns in this matrix indicate queries, and rows are ordered by distances from the query.


distances documentation built on Sept. 18, 2019, 5:03 p.m.