Learn R Programming

GeoRange (version 0.1.0)

GCD: Calculates the maximum pairwise great circle distance from a set of decimal degree coordinates

Description

Calculates the maximum pairwise great circle distance from a set of decimal degree coordinates

Usage

GCD(longs, lats)

Arguments

longs

- Longitudinal coordinates of occurrences in decimal degrees

lats

- Latitudinal coordinates of occurrences in decimal degrees

Value

Returns the maximum great circle distance in kilometers

Details

Because this function does not account for the possibility that a taxa may wrap around more than half the Earth the maximum value is half the circumference of the Earth, approximately 20,038 kilometers.

Examples

Run this code
longs<-c(34,156,-78)
lats<-c(45,12,9)
GCD(longs,lats)

Run the code above in your browser using DataLab