library(tidyverse)
library(DBI)
library(googlesheets4)
options(gargle_oauth_email = TRUE)
gs_2024 <- as_sheets_id("1Qymhw_LGN1Z00ip_qswa29yPeZzWvTymD-u-lMY8b-A")
nnhs_2024 <- read_sheet(gs_2024, na = c("", "N/A"))
#> ℹ The googlesheets4 package is using a cached token for '[email protected]'.
#> ✔ Reading from "NNHS2024".
#> ✔ Range 'Sheet1'.
nnhs_2024 |>
filter(!is.na(school)) |>
mutate(school = coalesce(school_conformed, school)) |>
count(school, sort = TRUE) |>
filter(n >= 4) |>
mutate(school = fct_inorder(school)) |>
ggplot(aes(x = school, y = n, fill = school)) +
geom_col() +
theme(axis.text.x = element_text(angle = 90)) +
guides(fill = "none", color = "none")
Created on 2024-07-03 with reprex v2.1.0