Learn R Programming

airportr (version 0.1.3)

airport_distance: Calculate great circle distance between two airports

Description

A function that calculates distances between pairs of airport codes. Distances are calculated using the Haversine formula which assumes a spherical earth. Distances are returned in kilometres.

Usage

airport_distance(airport1, airport2)

Arguments

airport1

Takes a three-letter IATA code corresponding to an airport

airport2

As above

Value

The great circle distance in kilometres between the two airports

Examples

Run this code
# NOT RUN {
airport_distance("YVR","YYZ")
# }

Run the code above in your browser using DataLab