Identify enrollment aggregation levels and charter status
Source:R/tidy_enrollment.R
id_enr_aggs.RdAdds boolean flags to identify state, district, and school level records, plus a charter school flag derived from the official NM PED school directory.
Details
Charter identification uses bundled reference data from NM PED's school directory (not name-pattern matching). State-chartered schools (authorized by the Public Education Commission) operate as their own LEA with district codes in the 500+ range. Locally-authorized charters are schools within traditional districts identified by their campus_id.
Examples
if (FALSE) { # \dontrun{
tidy_data <- fetch_enr(2025)
# Charter vs traditional enrollment
tidy_data |>
dplyr::filter(is_school, subgroup == "total_enrollment",
grade_level == "TOTAL") |>
dplyr::group_by(is_charter) |>
dplyr::summarize(n_schools = dplyr::n(),
students = sum(n_students, na.rm = TRUE))
} # }