Last active
September 10, 2024 21:01
-
-
Save vgXhc/98e2825649484fde5c068eb8eb74570d to your computer and use it in GitHub Desktop.
Madison Metro ridership chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| madison <- x |> filter(agency == "City of Madison" & modes == "MB" & tos == "DO" & year(month) >2018) | |
| max_month <- madison |> filter(year(month) == max(year(month))) |> | |
| summarize(max(month(month, label = T, abbr = F))) |> pull() | |
| madison |> | |
| mutate(month_label = month(month, label = T, abbr = T)) |> | |
| ggplot(aes(month, value)) + | |
| geom_col(aes(fill = month_label)) + | |
| geom_line() + | |
| theme_minimal() + | |
| #geom_point(data = x |> filter(agency == "City of Madison" & modes == "MB" & tos == "DO" & year(month) > 2016 & month(month) == 11)) + | |
| scale_x_date() + | |
| ylab("Unlinked passenger trips") + | |
| ylim(0,1500000) + | |
| labs(title = "Madison Metro monthly ridership", | |
| subtitle = paste0("Latest month shown: ", max_month, " 2024"), | |
| caption = "Data: National Transit Database") | |
| madison |> | |
| mutate(month_label = month(month, label = T, abbr = T), | |
| year = as.factor(year(month))) |> | |
| group_by(year(month), month_label) |> | |
| ggplot(aes(month_label, value, fill = year)) + | |
| geom_col(position = position_dodge()) + | |
| ylab("Unlinked passenger trips") + | |
| xlab("Month") + | |
| theme_minimal() + | |
| ylim(0,1500000) + | |
| labs(title = "Madison Metro monthly ridership", | |
| subtitle = paste0("Latest month shown: ", max_month, " 2024"), | |
| caption = "Data: National Transit Database") | |
| # For toot caption: A line chart titled "Madison Metro monthly ridership." Unlinked passenger trips on the y axis; the month on the x axis. Data from 2018 to March 2024 are shown. After the collapse during the beginning of the COVID pandemic, ridership has recovered to about 90% of prepandemic levels. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment