# K nearest neighbours

### Description

K nearest neighbours

### Usage

1 |

### Arguments

`query` |
Matrix containing the set of query points where each row represents a point. |

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

`checks` |
Number of checks during searching. |

### Value

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 |

### Author(s)

Yee, Jeremy

### Examples

1 2 3 4 |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.