Learn R Programming

fossil (version 0.4.0)

earth.dist: Calculating Geographic Distances

Description

Create a distance matrix (lower triangle) between a list of points

Usage

earth.dist(lats, dist = TRUE)

Arguments

lats

a table with a longitude and latitude column respectively as the first two columns

dist

A logical argument whether to create a distance matrix (lower triangle) or full matrix

Value

Returns a matrix of distances in kilometers between a list of longitudes and latitudes.

Details

This function will calculate the pairwise distances between all points given and return either a distance or full matrix as specified. All coordinates must be in decimal degrees.

See Also

deg.dist

Examples

Run this code
# NOT RUN {
data(fdata.lats)
earth.dist(fdata.lats)
# }

Run the code above in your browser using DataLab