`selectPairIndices`

Out of a list of locations given by their Cartesian coordinates, selects pairs of locations with a distance as a criterion.

1 | ```
selectPairIndices(locations, maxDistance = NULL, numberOfPairs = NULL)
``` |

`locations` |
A |

`maxDistance` |
Pairs of locations with distance not larger than |

`numberOfPairs` |
The number of pairs that will be selected, taking distance as a criterion, with closer pairs being selected. It will return more pairs if there are several equidistant locations. |

A matrix with `q`

rows and 2 columns, where `q`

denotes the number of pairs selected. Each row contains the indices of the corresponding pair of selected locations in the input argument `locations`

.

1 2 | ```
(locations<-cbind(rep(1:4,5),rep(1:5,each=4)))
selectPairIndices(locations, maxDistance = 1.5)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.