make_AP2
creates an airport-pair set from two sets of airports
Usage
make_AP2(adep, ades, ap = make_airports())
Arguments
- adep, ades
Identical-length lists of airport codes
- ap
List of locations of airports, defaults to the output of
make_airports
.
Details
This function takes two lists of airports (of the same length), specified as 4-letter codes and combines them, adding the fields:
from_long, from_lat, to_long, to_lat
: the airport lat-longs with adep firstAP2
: a name for the route in a specific ordergcdist_km
: the great circle distance in km
In AP2
European airports (crudely, from starting letter = 'E' or 'L')
are listed first, otherwise in alphabetical order. If unidirectional is TRUE,
then ">" is the separator, otherwise "<>".
(Unidirectional not currently supported)
For more details see the introductory vignette.
Examples
airports <- make_airports() #get a default set of lat-longs
#> Using default airport data: airportr::airport.
ap2 <- make_AP2("NZAA","NZCH", airports)