time_hour delay_times delay_length
Min. :2023-01-01 05:00:00.00 Length:870704 Min. : -97.000
1st Qu.:2023-03-30 20:00:00.00 Class :character 1st Qu.: -11.000
Median :2023-06-27 08:00:00.00 Mode :character Median : -4.000
Mean :2023-06-29 10:02:22.39 Mean : 9.101
3rd Qu.:2023-09-27 11:00:00.00 3rd Qu.: 9.000
Max. :2023-12-31 23:00:00.00 Max. :1813.000
NA's :23272
Creating, labeling and displaying the graph.
ggplot(flightslong) +geom_bar(aes(x = time_hour, y = delay_length, fill = delay_times),position ="dodge", stat ="identity") +ylim(-100, 1500) +scale_fill_discrete(name ="Type of Delay", labels =c("Departure Delays", "Arrival Delays")) +labs(y ="Length of the Delay (Minutes)",x ="Time of Departure",title ="NYC Delay Trends of 2023",caption ="Source: RITA, Bureau of transportation statistics, https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236")
Warning: Removed 23290 rows containing missing values or values outside the scale range
(`geom_bar()`).
Explanatory Paragraph
This graph shows the lengths of delays for scheduled flights that happened in NYC through the year 2023. The graph contains the delays of departures as well as arrivals, which are differentiated by their color on the graph. The highlight of the graph I would like to highlight is the negative delays, which indicated that some flights throughout the year departed or arrived before the scheduled time. Sadly, the outliers in the data, like some day-long delays, make it harder to see these early flights.