Skip to contents

Downloads and processes enrollment data from the Pennsylvania Department of Education data files.

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 are 2005-present (some years may have limited data or different formats).

tidy

If TRUE (default), returns data in long (tidy) format with subgroup column. If FALSE, returns wide format.

use_cache

If TRUE (default), uses locally cached data when available. Set to FALSE to force re-download from PDE.

Value

Data frame with enrollment data

Examples

if (FALSE) { # \dontrun{
# Get 2025 enrollment data (2024-25 school year)
enr_2025 <- fetch_enr(2025)

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

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