make_airports
ensures a minimum set of variables describing airports
Details
This function provides a test set of airports if necessary from
airportr::airports
and geocodes the lat-long of this or the dataset
provide as ap
.
This minimal set needs to have the following fields:
APICAO
: the 4-letter ICAO code for the airport (though there is no validity check applied, so 'TEST', or 'ZZZZ' could be used, for example)lat, long
: latitude and longitude in decimal degrees
Examples
# do minimal version
airports <- make_airports()
#> Using default airport data: airportr::airport.
# on-the-fly example
airports <- data.frame(APICAO = "TEST", lat = 10, long = 10, stringsAsFactors = FALSE)
airports <- make_airports(airports)
if (FALSE) { # \dontrun{
# example for your own data
airports <- utils::read.csv("data/airports.csv", stringsAsFactors = FALSE)
airports <- make_airports(airports)
} # }