Downloads and processes enrollment data from the Mississippi Department of Education data portal at newreports.mdek12.org.
Arguments
- end_year
A school year. Year is the end of the academic year - eg 2023-24 school year is year '2024'. Valid values: 2007, 2010, 2012-2013, 2016-2026. Years 2008-2009, 2011, 2014-2015 are unavailable on MDE portal.
- 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 MDE.
Value
Data frame with enrollment data. Wide format includes columns for district_id, school_id, names, and enrollment counts by demographic/grade. Tidy format pivots these counts into subgroup and grade_level columns.
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 specific district
jackson <- enr_2024 |>
dplyr::filter(district_name == "JACKSON PUBLIC SCHOOL DIST")
} # }