Skip to contents

Adds boolean flags to identify state, district, and school level records, plus a charter school flag derived from the official NM PED school directory.

Usage

id_enr_aggs(df)

Arguments

df

Enrollment dataframe, output of tidy_enr

Value

data.frame with boolean aggregation flags including is_charter

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))
} # }