Given a set of cartesian coordinates representing the locations of different objects, this function computes the distances between each possible pair of objects.

pdist(x, y, geo = FALSE)

Arguments

x

A vector of x (or longitude) coordinates.

y

A vector of y (or latitude) coordinates.

geo

A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.

Value

A length(x) * length(y) square matrix representing pairwise distances between all the objects.

See also

Examples

# TODO