create_flights: Create a data-only flights package

Description Usage Arguments Details Value Examples

Description

Create a data-only R pacakge of flights data, like nycflights13, but with user-specified airports, years, and direction (departing, arriving).

Usage

1
2
3
4
5
6
download_flightdata(airport_codes, year, data_dir = "./data",
  raw_dir = "./data-raw", origin = TRUE, dest = FALSE,
  all_weather = FALSE)

create_flights(path, airport_codes, year, origin = TRUE, dest = FALSE,
  all_weather = FALSE, description = getOption("devtools.desc"))

Arguments

airport_codes

A character vector of airport codes

year

Year of flights to download.

data_dir

Directory to save .rda file.

raw_dir

Directory to save .csv and intermediate files.

origin, dest

If origin (dest) is TRUE, keep all flights originating from (arriving at) airports. At least one of origin or dest must be TRUE.

all_weather

If TRUE, get weather for not just the chosen airports, but also all (domestic) airports appearing in the flight data.

path

Location to create new package. The last component of the path will be used as the package name.

description

A list of description values to override default values or add additional values.

Details

The function create_flights creates an R package with the flight data. The function download_flightdata downloads the data and saves .csv and .rda files to specified directories, but does not create an R package.

Value

A "package" object for the created package. This function is called for the side-effect of downloading the data and creating a package.

Examples

1
2
3
4
5
6
## Not run: 
  # Package with all flights departing from or arriving
  # at Seattle (SEA) in 2015.
  create_flights("seaflights15", "SEA", 2015, origin = TRUE, dest = TRUE)

## End(Not run)

jrnold/groundcontrol documentation built on May 20, 2019, 1:02 a.m.