Description Usage Arguments Value Examples
search_tree
build a persistent expandable k-d tree from a vector or
matrix.
1 | search_tree(y, tree, k = 5)
|
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. |
A vector of integers identifying nearest neighbors.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.