Learn R Programming

aspace (version 2.5)

distances: Multiple Euclidean distance calculator

Description

Compute distances from a source location (point) to a series of destination locations (points).

Usage

distances(centre.xy = centre, destmat = activities, verbose = FALSE)

Arguments

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

Value

  • 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.

Details

Distance computations are strictly Euclidean between the source point and each destination point.

Examples

Run this code
data(centre)
  data(activities)
  distances(centre.xy=centre, destmat=activities, verbose=FALSE)

Run the code above in your browser using DataLab