earth.dist {fossil}R Documentation

Calculating Geographic Distances

Description

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

Usage

earth.dist(x, dist = TRUE)

Arguments

x a table with a latitude and longitude column respectively as the first two columns
dist A logical argument whether to create a distance matrix (lower triangle) or full matrix

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.

Value

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

Note

Large datasets may take some time to process, as the number of distances to calculate is factorial in nature.

Author(s)

Matthew Vavrek

References

~put references to the literature/web site here ~

See Also

deg.dist

Examples

##area of 1/8th of the earth
a <- matrix(c(0,0,90,0,90,0),3,3)
earth.dist(a)
earth.dist(a, FALSE)

[Package fossil version 0.2.0 Index]