anyflights {anyflights}R Documentation

Query nycflights13-Like Air Travel Data

Description

This function generates a list of dataframes similar to those found in the nycflights13 data package for any US airports and time frames. Please note that, even with a strong internet connection, this function may take several minutes to download relevant data.

Usage

anyflights(station, year, month = 1:12, dir = NULL)

Arguments

station

A character vector giving the origin US airports of interest (as the FAA LID airport code).

year

A numeric giving the year of interest. This argument is currently not vectorized, as dataset sizes for single years are significantly large. Information for the most recent year is usually available by February or March in the following year.

month

A numeric giving the month(s) of interest.

dir

An optional character string giving the directory to save datasets in. By default, datasets will not be saved to file.

Details

The anyflights() function is a wrapper around the following functions:

The recommended approach to download data for many stations (airports) is to supply a vector of stations to the station argument rather than iterating over many calls to anyflights(). The faa column in dataframes outputted by get_airports() provides the FAA LID codes for all supported airports. See ?get_flights for more details on implementation.

Value

A list of dataframes (and, optionally, a directory of datasets) similar to those found in the nycflights13 data package.

See Also

get_flights for flight data, get_weather for weather data, get_airlines for airlines data, get_airports for airports data, or get_planes for planes data.

Use the as_flights_package function to convert the output of this function to a data-only package.

Examples

# grab data on all flights departing from 
# Portland International Airport in June 2019 and 
# other useful metadata without saving to file
## Not run: anyflights("PDX", 2018, 6)

# ...or, grab that same data and opt to save the 
# file as well! (tempdir() can usually be specified 
# as a character string giving the path to a folder)
## Not run: anyflights("PDX", 2018, 6, tempdir())


[Package anyflights version 0.3.4 Index]