`summarise()` has grouped output by 'carrier'. You can override using the
`.groups` argument.
#Top 20 Destination Airports by Delayed Arrivals from NYC (FFA Codes)
ggplot(heatmap_data, aes(x =factor(month), y = carrier, fill = avg_arr_delay)) +geom_tile(color ="lightblue") +labs(title ="Top 20 Destination Airports by Dealyed Arrivals from NYC (FFA Codes)",x ="Month",y ="Airline Carrier",fill ="Avg Arrival Delay (mins)",caption ="Source: nycflights23 package" ) +scale_fill_gradient(low ="lavender", high ="red") +theme_minimal()
This heatmap is based on late arrival performance data for the nycflights23 dataset, an excerpt of all flights that left New York City in 2023. The months are represented on the x-axis, and the airline carriers are displayed by their carrier names on the y-axis. Each tile is shaded according to the airline’s average arrival delay for that month. The shades vary from lavender to red, and the darkest red colors indicate the most substantial delays.
One obvious thing to notice on this heatmap is that during winter, there are more delays across several airlines possibly due to snow or ice affecting flight schedules. Sign Up Airlines, as with flight prices, there are no guarantees while monitoring price points of individual airlines. But several are fairly reliable. This is an interesting visualization for comparing the performance of different airlines and shows how conditions are seasonal factors that lead to delays.