Find nearest neighbors between two sets of data points
Examples
# \donttest{
X <- matrix(rnorm(20), nrow=5)
nn <- nnsearcher(X)
find_nn_between(nn, k=1, idx1=1:2, idx2=3:5)
#> $labels
#> [,1]
#> [1,] 1
#> [2,] 1
#> [3,] 1
#>
#> $indices
#> [,1]
#> [1,] 1
#> [2,] 1
#> [3,] 1
#>
#> $distances
#> [,1]
#> [1,] 2.793294
#> [2,] 2.665216
#> [3,] 1.572280
#>
#> attr(,"len")
#> [1] 4
#> attr(,"metric")
#> [1] "l2"
#> attr(,"class")
#> [1] "nn_search"
# }