get_airlines {anyflights}R Documentation

Query nycflights13-Like Airlines Data

Description

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.

Usage

get_airlines(dir = NULL, flights_data = NULL)

Arguments

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 get_flights that will be used to subset the output to only include relevant carriers/planes. If not supplied, all carriers/planes will be returned.

Value

A data frame with <2k rows and 2 variables:

carrier

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

name

Full name

Source

https://www.bts.gov/

See Also

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.

Examples


# run with defaults
## Not run: 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
## Not run: get_airlines(flights_data = get_flights("PDX", 2018, 6))


[Package anyflights version 0.3.4 Index]