adjacent attempts to find the point(s) adjacent
(closest) to each point. The data are implicitly assumed
to be on a grid, otherwise this function isn't very
useful. Distances between each point and other points in
coords are computed and then rounded using the
round function. Let k denote
the minimum distance between a reference point and all
other points. A point is adjacent to the reference point
if (after rounding), it's distance from the reference
point matches the minimum distance k.
Usage
adjacent(coords, longlat = FALSE, digits = 1)
Value
A hero_adjacent object. This is simply a
list with elements nbrs and coords.
nbrs is a list specifying the adjacent points
for each point. coords is simply the original
coords supplied to the function and is retained
for plotting purposes.
Arguments
coords
A two-dimensional matrix-like object with
non-NULL dimensions.
longlat
A logical value indicating whether Great
Circle distances should be used (TRUE) or
Euclidean distances (FALSE). The default is
FALSE.
digits
The number of digits to use when applying
round to the distances.
Details
digits is the number of digits used by
round in the rounding process.