lets.distmat | R Documentation |
Calculates a geographic distance matrix based on a
PresenceAbsence
or a two column matrix
of x(longitude) and
y(latitude).
lets.distmat(xy, asdist = TRUE)
xy |
A |
asdist |
Logical, if |
This function basically facilitates the use of
terra::distance
on a PresenceAbsence
object, allowing also
the user to have directly a dist
object. The distance is always
expressed in meter if the coordinate reference system is
longitude/latitude, and in map units otherwise. Map units are typically
meter, but inspect crs(x) if in doubt.
The user can choose between dist
and matrix
class
object to be returned. The resulting values are in kilometres (but see the
argument 'unit' in rdist.earth
).
Bruno Vilela & Fabricio Villalobos
## Not run:
data(PAM)
distPAM <- lets.distmat(PAM)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.