View source: R/Geographic_distance_functions.R
GeoDist2PointTable | R Documentation |
This function uses the geosphere
package function distHaversine
to calculate pairwise distances among all inputted Latitude Longitude coordinates.
GeoDist2PointTable(RefLatLongs, IDs = NA)
RefLatLongs |
a matrix of n rows by 2 columns where n is the number of coordinates and the columns are Latitude and Longitude values in that order. |
IDs |
a vector of unique IDs that correspond with (and are in the same order as) the Latitude Longitude coordinates. These IDs will then be used to name the columns and the rows of the returned table of pairwise distances. The default is set to NA. If set to NA the returned table will not have named columns or rows. |
A square matrix of pairwise distances in metres among all inputted coordinates (RefLatLongs).
Sinnott, R.W, 1984. Virtues of the Haversine. Sky and Telescope 68(2): 159
Robert J. Hijmans (2017). geosphere: Spherical Trigonometry. R package version 1.5-7. https://CRAN.R-project.org/package=geosphere
Ardern Hulme-Beaman
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.