Description Usage Arguments Value Author(s) Examples

K nearest neighbours

1 |

`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. |

`k` |
Number of nearest neighbours to search for. |

`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. |

List containing:

`indices` |
Matrix containing the index of the nearest neighbours in the reference set for each query set of points |

`distances` |
Matrix containing the distances to the nearest neighbours |

Yee, Jeremy

1 2 3 4 |

```
$indices
[,1] [,2] [,3]
[1,] 3 5 1
[2,] 3 5 4
[3,] 2 3 1
[4,] 5 3 1
[5,] 2 3 4
$distances
[,1] [,2] [,3]
[1,] 0.3048164 0.3959277 1.247120
[2,] 0.5941663 0.8706599 2.589433
[3,] 1.5930031 2.1528606 2.929196
[4,] 1.8134292 3.0668465 4.304286
[5,] 0.1361710 1.9594569 2.685418
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.