Please note that, even with a strong internet connection, this function may take several minutes to download relevant data, and temporarily requires up to 2GB of storage (the file size is trimmed down significantly after some post-processing---to the order of a couple MB---and the larger files are deleted before termination)
get_flights(station, year, dir)
A character string---the airport of interest (use the FAA LID airport code).
The year of interest, as an integer (unquoted). Currently, years 2015 and on are supported. Information for the most recent year is usually available by February or March in the following year.
A character string--the folder for the dataset to be saved in
A data frame with ~10k-500k rows and 19 variables:
Date of departure
Actual departure and arrival times, local tz.
Scheduled departure and arrival times, local tz.
Departure and arrival delays, in minutes. Negative times represent early departures/arrivals.
Time of scheduled departure broken into hour and minutes.
Two letter carrier abbreviation. See get_airlines
to get name
Plane tail number
Flight number
Origin and destination. See get_airports
for
additional metadata.
Amount of time spent in the air, in minutes
Distance between airports, in miles
Scheduled date and hour of the flight as a POSIXct
date.
Along with origin
, can be used to join flights data to weather data.
get_airports
for airport data,
get_weather
for weather data, get_airlines
for airline data, and anyflights
for a wrapper function
# NOT RUN {
get_flights(station = "MCI", year = 2016, dir = tempdir())
# }
Run the code above in your browser using DataCamp Workspace