Learn R Programming

tbart (version 1.0)

euc.dists: Euclidean distances from a Spatial* or Spatial*DataFrame object

Description

Euclidean distances from a Spatial* or Spatial*DataFrame object

Usage

euc.dists(swdf1, swdf2, scale)

Arguments

swdf1
- First Spatial*DataFrame object
swdf2
- Second Spatial*DataFrame object (if omitted, defaults to the same value as swdf1)
scale
- allows re-scaling eg: value of 1000 means distances in km if coordinates of swdf1/swdf2 in meters.

Value

Distance matrix (if swdf1 or swdf2 not SpatialPoints*, distances are based on points obtained from coordinates function)

Examples

Run this code
data(meuse)
coordinates(meuse) <- ~x+y
euc.dists(meuse,scale=1000)

Run the code above in your browser using DataLab