Learn R Programming

carbonr (version 0.2.1)

distance_calc: Distance calculator

Description

Calculate distances between locations in miles using the Haversine formula. This is calculated as the crow flies.

Usage

distance_calc(lat1, lat2, long1, long2)

Value

Distance between locations in miles

Arguments

lat1

Latitude of the first location.

lat2

Latitude of the second location.

long1

Longitude of the first location.

long2

Longitude of the second location.

Examples

Run this code
# Distance between the London Eye and the Eiffel Tower in miles
distance_calc(51.5033, 48.8584, 0.1196, 2.2945)

Run the code above in your browser using DataLab