I then did some quick googleing and there was indeed a winter storm on the 8th, I therefore created a second set to see if I can find it in case it does not appear in the first set.
february_789_flights <- flights_nona |>group_by(origin) |>filter(month ==02, day ==08, na.rm =TRUE)
My original plan was to calculate the number of seats lost in relation to the severity of the storm, however I could not arrive at a good relation in time.
Warning: Returning more (or less) than 1 row per `summarise()` group was deprecated in
dplyr 1.1.0.
ℹ Please use `reframe()` instead.
ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
always returns an ungrouped data frame and adjust accordingly.
`summarise()` has grouped output by 'origin'. You can override using the
`.groups` argument.
`summarise()` has grouped output by 'origin'. You can override using the
`.groups` argument.
Month of February
ggalluv <- Seats_Day |>ggplot(aes(x = day, y = total_seats_day, alluvium = origin)) +theme_bw() +geom_alluvium(aes(fill = origin), color ="black", alpha =1) +scale_fill_manual(values =wes_palette(n =3, name ="FantasticFox1" )) +scale_x_continuous(breaks =1:28, limits =c(1,28)) +labs(title ="A storm hits New York on February 8th and 9th 2013",y ="Number of Seats", x ="Days of the Month of February",fill ="Airport of Origin")
ggalluv
But not only have we found that a storm appears in our data, no, because this is no ordinary storm.
ggalluv <- Seats_Day |>ggplot(aes(x = day, y = total_seats_day, alluvium = origin)) +theme_bw() +geom_alluvium(aes(fill = origin), color ="black", alpha =1) +scale_fill_manual(values =wes_palette(n =3, name ="FantasticFox1" )) +scale_x_continuous(breaks =1:28, limits =c(1,28)) +labs(title ="Finding Nemo: The effect of a winter storm on EWR,JFK and LGA",y ="Number of Seats", x ="Days of the Month of February",fill ="Airport of Origin")
ggalluv
Conclusion
Well so I accidentally found a storm named “Nemo”. What I think is particularly neat about this graph is how clear it comes through in the data. My original idea was to use both passenger numbers and number of aircraft to demonstrate how small and private aircraft are less resilient. However, passenger numbers also more accurately “weighs” the capacity of the airports and I was worried that the signal of the February storms could be buried by the fluctuations in the number of small passenger aircraft. To my delight, we can see how the number of potential passengers(represented by the total number of seats across all aircraft) that landed at JFK, EWR and LGA plummeted between the 8th of February to the 10th of February. As for the reason that the passenger numbers do not reach zero on those days, it turns out the airports were still operating until the late afternoon on the 8th and managed to return to operation later in the day on the 9th.