search_tree: Search for k nearsest neighbors in a persistent expandable...

Description Usage Arguments Value Examples

Description

search_tree build a persistent expandable k-d tree from a vector or matrix.

Usage

1
search_tree(y, tree, k = 5)

Arguments

y

A vector to search for in the k-d tree.

tree

A K-d tree stored as a POETree object.

k

A scalar used to specify the number of neighbors to return from the nearest neighbor search.

Value

A vector of integers identifying nearest neighbors.

Examples

1
2
3
4
5
x <- matrix(runif(20),10,2)
# find the four closest nearest neighbors
myTree <- create_tree(x)
y <- c(0,0)
neighbors <- search_tree(y,myTree,k=4)

jlisic/POETree documentation built on May 19, 2019, 12:46 p.m.