Skipping install of 'nycflights23' from a github remote, the SHA1 (54a296ac) has not changed since last install.
Use `force = TRUE` to force installation
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(alluvial)library(ggalluvial)data_processed <- flights %>%mutate(year =as.integer(format(time_hour, "%Y"))) %>%group_by(year, carrier) %>%tally(name ="flights") %>%ungroup()# Create the alluvial plotggplot(data_processed, aes(axis1 = year, axis2 = carrier, y = flights)) +geom_alluvium(aes(fill = carrier), width =0.2) +geom_stratum(width =0.2) +geom_text(stat ="stratum", aes(label =after_stat(stratum))) +scale_x_discrete(limits =c("Year", "Carrier"), expand =c(0.15, 0.05)) +theme_minimal() +labs(title ="Alluvial Diagram of Flights by Carrier and Year",x ="",y ="Number of Flights")
My visualization is an alluvial that shows the number of flights in 2023 by carrier. One thins I would like to highlight about this visualization isn’t so much a good thing. some of the carriers don’t have large enough values so the labels cannot fit in some of the areas.