Skip to contents

Downloads and processes canonical Connecticut enrollment data.

Usage

fetch_enr(end_year, tidy = TRUE, use_cache = TRUE)

Arguments

end_year

A school year. Year is the end of the academic year - eg 2023-24 school year is year '2024'. Valid values depend on the canonical bundled source registry returned by get_available_years().

tidy

If TRUE (default), returns data in long (tidy) format with subgroup column plus aggregation flags. If FALSE, returns the canonical pre-tidied district/state rows without aggregation flags.

use_cache

If TRUE (default), uses locally cached data when available. Set to FALSE to force a fresh canonical source lookup.

Value

Data frame with canonical district/state enrollment data.

Examples

if (FALSE) { # \dontrun{
# Get 2024 enrollment data (2023-24 school year)
enr_2024 <- fetch_enr(2024)

# Get wide format
enr_wide <- fetch_enr(2024, tidy = FALSE)

# Force fresh download (ignore cache)
enr_fresh <- fetch_enr(2024, use_cache = FALSE)

# Filter to Hartford Public Schools
hartford <- enr_2024 |>
  dplyr::filter(grepl("Hartford", district_name))
} # }