This function generates a dataframe similar to the
airlines
dataset from nycflights13
for any US airports and time frame. Please
note that, even with a strong internet connection, this function
may take several minutes to download relevant data.
get_airlines(dir = NULL, flights_data = NULL)
dir | An optional character string giving the directory to save datasets in. By default, datasets will not be saved to file. |
---|---|
flights_data | Optional---either a filepath as a
character string or a dataframe outputted by |
A data frame with <2k rows and 2 variables:
Two or three length letter or number abbreviation. In cases whgere the the Unique Carrier Code has been use more than once, a suffix is added. ex. ML, ML (1). This list matches the `Reporting_Airline` field in the BTS documentation for the flights data set
Full name
get_flights
for flight data,
get_weather
for weather data,
get_airports
for airports data,
get_planes
for planes data,
or anyflights
for a wrapper function.
Use the as_flights_package
function to convert this dataset
to a data-only package.
# run with defaults
if (FALSE) get_airlines()
# if you'd like to only return the airline
# abbreviations only for airlines that appear in
# \code{flights}, query your flights dataset first,
# and then supply it as a flights_data argument
if (FALSE) get_airlines(flights_data = get_flights("PDX", 2018, 6))