dist_calc: A simple distance calculator for two sets of geo coordinates....

Description Usage Arguments References

View source: R/dist_calc.R

Description

A simple distance calculator for two sets of geo coordinates. This function may be utilized to estimate the "straight line" distance between two sets of, e.g., Google Web Mercator/WGS 84 geocoordinates.

Usage

1
dist_calc(long1, lat1, long2, lat2, units = "metric")

Arguments

long1

numeric; the longitude (degrees) of location 1.

lat1

numeric; the latitude (degrees) of location 1.

long2

numeric; the longitude (degrees) of location 2.

lat2

numeric; the latitude (degrees) of location 2.

units

character string; must be either "metric" (the default) or "imperial". Specifying "metric" will return the distance between location 1 and location in kilometers, whereas "imperial" returns the distance in miles.

References

http://menugget.blogspot.com/2011/05/r-functions-for-earth-geographic_29.html


placement documentation built on May 29, 2017, 11:54 p.m.