Skip to content

Instantly share code, notes, and snippets.

@vgXhc
Created May 14, 2025 20:32
Show Gist options
  • Select an option

  • Save vgXhc/e4bc94b1e754890f41470b065f73934a to your computer and use it in GitHub Desktop.

Select an option

Save vgXhc/e4bc94b1e754890f41470b065f73934a to your computer and use it in GitHub Desktop.
Metro rider charts 2025
library(tidyverse)
library(scales)
madison_vrh <- get_ntd(agency = "City of Madison", ntd_variable = "VRH")
extrafont::loadfonts()
madison_vrh |>
filter(modes == "MB") |>
mutate(year = year(month), mo = month(month)) |>
filter(mo == 3) |>
summarize(mean_vrh = mean(value), .by = year) |>
ggplot(aes(year, mean_vrh)) +
geom_point() +
geom_line() +
ylim(c(0, 40000)) +
scale_y_continuous(labels = label_number_auto(), name = "vehicle revenue hours")
ylab("vehicle revenue hours") +
labs(title = "Madison Metro vehicle revenue hours in March, 2002-2024") +
hrbrthemes::theme_ipsum()
madison_vrm <- get_ntd(agency = "City of Madison", ntd_variable = "VRM")
madison_vrm |>
filter(modes == "MB") |>
mutate(year = year(month), mo = month(month)) |>
filter(mo == 3) |>
summarize(mean_vrm = mean(value), .by = year) |>
ggplot(aes(year, mean_vrm)) +
geom_point() +
geom_line() +
scale_y_continuous(labels = label_number_auto(), name = "vehicle revenue miles",
limits = c(0, 500000)) +
labs(title = "Madison Metro vehicle revenue miles in March, 2002-2025") +
hrbrthemes::theme_ipsum()
madison_upt <- get_ntd(agency = "City of Madison", ntd_variable = "UPT")
madison_upt |>
filter(modes == "MB") |>
mutate(year = year(month), mo = month(month)) |>
filter(mo == 4) |>
summarize(mean_upt = mean(value), .by = year) |>
ggplot(aes(year, mean_upt)) +
geom_point() +
geom_line() +
# scale_y_continuous(labels = label_number_auto(), name = "vehicle revenue miles",
# limits = c(0, 500000)) +
labs(title = "Madison Metro vehicle revenue miles in March, 2002-2025") +
hrbrthemes::theme_ipsum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment