get_neighbours.Rd
Select neighbouring locations of a given origin
get_neighbours(origin, candidates, d_limit = Inf)
A numeric vector of length two containing respectively the longitude and latitude coordinate of the origin location.
A data.frame
or similar representing the
set of possible neighbour locations to choose from. Should have only three
columns, with the first column containing unique indices for each location,
and the second and third column containing respectively the longitude and
latitude coordinates of each location.
Upper distance limit (as-the-crow-flies) in meters to
consider a candidate location as a neighbour of the origin. Defaults to
Inf
, meaning that each candidate location will be a neighbour.
A subset of candidates
.
Coordinates should be expressed in coordinate reference system EPSG:4326. The function assumes this to be true, and does not check for it.