Step 0: Load required packages
Step 1: Load CSV Data
V1 YEAR MONTH DAY DAY_OF_WEEK AIRLINE FLIGHT_NUMBER TAIL_NUMBER
<int> <int> <int> <int> <int> <char> <int> <char>
1: 1 2015 1 1 4 AA 2336 N3KUAA
2: 2 2015 1 1 4 US 840 N171US
3: 3 2015 1 1 4 AA 258 N3HYAA
4: 5 2015 1 1 4 DL 806 N3730B
5: 6 2015 1 1 4 NK 612 N635NK
6: 7 2015 1 1 4 US 2013 N584UW
ORIGIN_AIRPORT DESTINATION_AIRPORT SCHEDULED_DEPARTURE DEPARTURE_TIME
<char> <char> <int> <num>
1: LAX PBI 10 2
2: SFO CLT 20 18
3: LAX MIA 20 15
4: SFO MSP 25 20
5: LAS MSP 25 19
6: LAX CLT 30 44
DEPARTURE_DELAY TAXI_OUT WHEELS_OFF SCHEDULED_TIME ELAPSED_TIME AIR_TIME
<num> <num> <num> <num> <num> <num>
1: -8 12 14 280 279 263
2: -2 16 34 286 293 266
3: -5 15 30 285 281 258
4: -5 18 38 217 230 206
5: -6 11 30 181 170 154
6: 14 13 57 273 249 228
DISTANCE WHEELS_ON TAXI_IN SCHEDULED_ARRIVAL ARRIVAL_TIME ARRIVAL_DELAY
<int> <num> <num> <int> <num> <num>
1: 2330 737 4 750 741 -9
2: 2296 800 11 806 811 5
3: 2342 748 8 805 756 -9
4: 1589 604 6 602 610 8
5: 1299 504 5 526 509 -17
6: 2125 745 8 803 753 -10
DIVERTED CANCELLED CANCELLATION_REASON AIR_SYSTEM_DELAY SECURITY_DELAY
<int> <int> <char> <num> <num>
1: 0 0 NA NA
2: 0 0 NA NA
3: 0 0 NA NA
4: 0 0 NA NA
5: 0 0 NA NA
6: 0 0 NA NA
AIRLINE_DELAY LATE_AIRCRAFT_DELAY WEATHER_DELAY
<num> <num> <num>
1: NA NA NA
2: NA NA NA
3: NA NA NA
4: NA NA NA
5: NA NA NA
6: NA NA NA
[1] "V1" "YEAR" "MONTH"
[4] "DAY" "DAY_OF_WEEK" "AIRLINE"
[7] "FLIGHT_NUMBER" "TAIL_NUMBER" "ORIGIN_AIRPORT"
[10] "DESTINATION_AIRPORT" "SCHEDULED_DEPARTURE" "DEPARTURE_TIME"
[13] "DEPARTURE_DELAY" "TAXI_OUT" "WHEELS_OFF"
[16] "SCHEDULED_TIME" "ELAPSED_TIME" "AIR_TIME"
[19] "DISTANCE" "WHEELS_ON" "TAXI_IN"
[22] "SCHEDULED_ARRIVAL" "ARRIVAL_TIME" "ARRIVAL_DELAY"
[25] "DIVERTED" "CANCELLED" "CANCELLATION_REASON"
[28] "AIR_SYSTEM_DELAY" "SECURITY_DELAY" "AIRLINE_DELAY"
[31] "LATE_AIRCRAFT_DELAY" "WEATHER_DELAY"
Step 2: Clean the Data
V1 YEAR MONTH DAY DAY_OF_WEEK AIRLINE FLIGHT_NUMBER TAIL_NUMBER
<int> <int> <int> <int> <int> <char> <int> <char>
1: 1 2015 1 1 4 AA 2336 N3KUAA
2: 2 2015 1 1 4 US 840 N171US
3: 3 2015 1 1 4 AA 258 N3HYAA
4: 5 2015 1 1 4 DL 806 N3730B
5: 6 2015 1 1 4 NK 612 N635NK
6: 7 2015 1 1 4 US 2013 N584UW
ORIGIN_AIRPORT DESTINATION_AIRPORT SCHEDULED_DEPARTURE DEPARTURE_TIME
<char> <char> <int> <num>
1: LAX PBI 10 2
2: SFO CLT 20 18
3: LAX MIA 20 15
4: SFO MSP 25 20
5: LAS MSP 25 19
6: LAX CLT 30 44
DEPARTURE_DELAY TAXI_OUT WHEELS_OFF SCHEDULED_TIME ELAPSED_TIME AIR_TIME
<num> <num> <num> <num> <num> <num>
1: -8 12 14 280 279 263
2: -2 16 34 286 293 266
3: -5 15 30 285 281 258
4: -5 18 38 217 230 206
5: -6 11 30 181 170 154
6: 14 13 57 273 249 228
DISTANCE WHEELS_ON TAXI_IN SCHEDULED_ARRIVAL ARRIVAL_TIME ARRIVAL_DELAY
<int> <num> <num> <int> <num> <num>
1: 2330 737 4 750 741 -9
2: 2296 800 11 806 811 5
3: 2342 748 8 805 756 -9
4: 1589 604 6 602 610 8
5: 1299 504 5 526 509 -17
6: 2125 745 8 803 753 -10
DIVERTED CANCELLED CANCELLATION_REASON AIR_SYSTEM_DELAY SECURITY_DELAY
<int> <int> <char> <num> <num>
1: 0 0 NA NA
2: 0 0 NA NA
3: 0 0 NA NA
4: 0 0 NA NA
5: 0 0 NA NA
6: 0 0 NA NA
AIRLINE_DELAY LATE_AIRCRAFT_DELAY WEATHER_DELAY Status
<num> <num> <num> <char>
1: NA NA NA On-Time
2: NA NA NA On-Time
3: NA NA NA On-Time
4: NA NA NA On-Time
5: NA NA NA On-Time
6: NA NA NA Delayed
[1] "V1" "YEAR" "MONTH"
[4] "DAY" "DAY_OF_WEEK" "AIRLINE"
[7] "FLIGHT_NUMBER" "TAIL_NUMBER" "ORIGIN_AIRPORT"
[10] "DESTINATION_AIRPORT" "SCHEDULED_DEPARTURE" "DEPARTURE_TIME"
[13] "DEPARTURE_DELAY" "TAXI_OUT" "WHEELS_OFF"
[16] "SCHEDULED_TIME" "ELAPSED_TIME" "AIR_TIME"
[19] "DISTANCE" "WHEELS_ON" "TAXI_IN"
[22] "SCHEDULED_ARRIVAL" "ARRIVAL_TIME" "ARRIVAL_DELAY"
[25] "DIVERTED" "CANCELLED" "CANCELLATION_REASON"
[28] "AIR_SYSTEM_DELAY" "SECURITY_DELAY" "AIRLINE_DELAY"
[31] "LATE_AIRCRAFT_DELAY" "WEATHER_DELAY" "Status"
Step 3: Summarize the Data
Status Count
<char> <int>
1: On-Time 1130686
2: Delayed 790486
3: Canceled 28570
AIRLINE AvgDepartureDelay
<char> <num>
1: AA 10.285748
2: US 5.367125
3: DL 7.801349
4: NK 19.520351
5: UA 16.183569
6: HA 3.736247
7: EV 9.126529
8: B6 14.368448
9: F9 13.457378
10: OO 10.053472
11: WN 12.653386
12: AS 2.679153
13: MQ 10.982612
14: VX 9.437387
ORIGIN_AIRPORT Count
<char> <int>
1: LAX 194673
2: SFO 148008
3: LAS 133181
4: DEN 196055
5: MSP 112117
6: PHX 146815
7: ORD 285884
8: DFW 239551
9: IAH 146622
10: ATL 346836
Step 4a: Flight Counts by Status
Step 4b: Average Departure Delay by Airline
Step 5: Top 10 busiest origin airports
Step 6a: Average departure delay by airline
Step 7: Top 10 Busiest Origin Airports
Step 8: Top 10 Routes by Average Departure Delay
##Step 9: Interactive Delay Analysis by Month, Airline, and Day of Week