distance: Computes distance between pairs of locations
Description
This function computes euclidean distance or distance
vector for each pair of a set of spatial locations.
Usage
distance(coord, vec = FALSE)
Arguments
coord
A matrix representing the coordinates of each
locations. Each row corresponds to one location.
vec
Logical. If FALSE (default), the euclidean distance
is computed. Otherwise, ``distance vectors'' are returned.
Value
If vec = FALSE, this function returns a vector that gives the
euclidean distance for each pair of locations. Otherwise, this is a
matrix where each column correspond to one dimension -
i.e. longitude, latitude, …