getFlightDelayData: Get filtered flight delays

View source: R/data_flights.R

getFlightDelayDataR Documentation

Get filtered flight delays

Description

Get filtered flight delay data, containing only a selection of dates and airports. Currently, all possible selections correspond to the case study in \localCiteThen2022.

Usage

getFlightDelayData(
  what = c("delays", "IATAs", "dates"),
  airportFilter = c("all", "tcCluster", "tcAll"),
  dateFilter = c("all", "tcTrain", "tcTest", "tcAll"),
  delayFilter = c("totals", "arrivals", "departures")[1]
)

Arguments

what

Whether to get the array of delays (numerical), or just the vector of airport codes ("IATAs", strings) or dates (as strings). Specify exactly one.

airportFilter

Which airports to include. Specify exactly one. See details below.

dateFilter

Which dates to include. Specify exactly one. See details below.

delayFilter

Which kinds of delays to include. Specify one or more. Possible values are "arrivals", "departures", and "totals" (computed as sum of arrival and departure delays).

Details

The provided lists of airports and dates correspond to the ones used in the case study of \localCiteThen2022. The argument airportFilter="tcCluster" corresponds to the airports in the analyzed "Texas Cluster", airportFilter="tcAll" corresponds to all airports used in the previous clustering step, airportFilter="all" corresponds to all airports in the dataset.

Similarly, dateFilter="tcTrain" selects the dates from the training set, dateFilter="tcTest" the ones from the test/validation set. To get the union of these sets, specify dateFilter="tcAll". To get all dates in the dataset (possibly more than for "tcAll"), specify dateFilter="all".

Value

If what="IATAs" or what="dates", a character vector. If required, it can be converted to Date objects using as.Date().

If what="delays", a three-dimensional array or two-dimensional matrix, with dimensions corresponding to dates, airports, and delay types.

References

\insertAllCited

See Also

Other flight data related topics: flightCountMatrixToConnectionList(), flights, plotFlights()


graphicalExtremes documentation built on Nov. 14, 2023, 1:07 a.m.