RadiusSearch: Radius searching

Description Usage Arguments Value Author(s) Examples

View source: R/RadiusSearch.R

Description

Radius searching

Usage

1
2
RadiusSearch(query, ref, radius, max_neighbour, build = "kdtree",
cores = 0, checks = 1)

Arguments

query

Matrix or data frame containing the set of query points where each row represents a point.

ref

Matrix or data frame containing the set of reference points where each row represents a point.

radius

Squared euclidean distance from each query point.

max_neighbour

Maximum number of points to look for within the radius of each query point.

build

String indicating the search structure to be used: "kdtree", "kmeans", "linear"

.

cores

Number of cpu cores to be used for searching. If 0, then the maximum allowable cores are used.

checks

Number of checks during searching. Higher value gives better search precision but takes longer. See FLANN C++ manual for more details.

Value

List containing:

indices

List containing the index of points in the reference set that lie in the radius of each query point.

distances

List containing the corresponding squared distances.

Author(s)

Yee, Jeremy

Examples

1
2
3
4
## Radius searching
query <- matrix(rnorm(10), ncol = 2)
reference <- matrix(rnorm(10), ncol = 2)
RadiusSearch(query, reference, 1, 2, "kdtree", 0, 1)

Example output

$indices
$indices[[1]]
[1] 3 4

$indices[[2]]
numeric(0)

$indices[[3]]
[1] 4 3

$indices[[4]]
numeric(0)

$indices[[5]]
numeric(0)


$distances
$distances[[1]]
[1] 0.05168248 0.26693088

$distances[[2]]
numeric(0)

$distances[[3]]
[1] 0.2999382 0.4161051

$distances[[4]]
numeric(0)

$distances[[5]]
numeric(0)

rflann documentation built on May 29, 2017, 12:37 p.m.