distances | R Documentation |
Compute distances from a source location (point) to a series of destination locations (points).
distances(centre.xy = NULL, destmat = NULL, verbose = FALSE)
centre.xy |
Two-element vector containing x,y coordinates of the source location |
destmat |
Two-column matrix or data frame containing x,y coordinates of the activity locations |
verbose |
Boolean: Set to T if verbose output is desired |
Distance computations are strictly Euclidean between the source point and each destination point.
A vector of distances, where each element corresponds to one of the distance between the source point and a destination (one row) from the destinations matrix.
The order of distances in the output vector corresponds to the order of destination points in the destinations object starting at row = 1 through row = n.
Tarmo K. Remmel
data(centre)
data(activities)
distances(centre.xy=centre, destmat=activities, verbose=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.