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.
airport_distance(airport1, airport2)The great circle distance in kilometres between the two airports
airport_distance("YVR","YYZ")
#> [1] 3346.562