distances: Multiple Euclidean distance calculator

Description Usage Arguments Details Value Note Author(s) Examples

Description

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

Usage

1
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

Details

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

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.

Note

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.

Author(s)

Tarmo K. Remmel

Examples

1
2
3
  data(centre)
  data(activities)
  distances(centre.xy=centre, destmat=activities, verbose=FALSE)  

Example output

Loading required package: splancs
Loading required package: sp

Spatial Point Pattern Analysis Code in S-Plus
 
 Version 2 - Spatial and Space-Time analysis

Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following object is masked from 'package:splancs':

    zoom

The following objects are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units

Loading required package: shapefiles
Loading required package: foreign

Attaching package: 'shapefiles'

The following objects are masked from 'package:foreign':

    read.dbf, write.dbf

 [1] 28499.02 16621.36 12813.67 31829.45 18018.87 15912.03 13338.89 13004.51
 [9] 24571.60 14902.33

aspace documentation built on May 2, 2019, 6:24 a.m.