distcalc | R Documentation |
Calculates pairwise geographic distance between locations on earth. Just a convenient wrapper for fields::rdist.earth().
distcalc(lat, lng, sampIDs = NULL)
lat |
Numeric vector. Latitudes in decimal degree format. |
lng |
Numeric vector. Longitudes in decimal degree format. |
sampIDs |
Character vector. Sample identifiers. Only required if output dist should have names associated. |
matrix containing all pairwise geographic distances in km.
John L. Darcy
# library(specificity)
# attach(endophyte)
# geo_dists <- distcalc(metadata$Lat, metadata$Lon, metadata$SampleID)
# all(rownames(geo_dists) == metadata$SampleID)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.