GeoDist2PointTable: Returns a table of Haversine distances

View source: R/Geographic_distance_functions.R

GeoDist2PointTableR Documentation

Returns a table of Haversine distances

Description

This function uses the geosphere package function distHaversine to calculate pairwise distances among all inputted Latitude Longitude coordinates.

Usage

GeoDist2PointTable(RefLatLongs, IDs = NA)

Arguments

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.

Value

A square matrix of pairwise distances in metres among all inputted coordinates (RefLatLongs).

Citations

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

Author(s)

Ardern Hulme-Beaman


ArdernHB/GeoOrigins documentation built on Nov. 19, 2022, 10:21 a.m.