Fetch New Hampshire staff/personnel data
Source:R/fetch_staff.R, R/source_surface_docs.R
fetch_staff.RdLoads and processes NH DOE Bureau of Educational Statistics staff data into the canonical tidy staff schema. The bundled official CSVs cover:
FTE staff counts by role (2017-2022): teacher, instruction support, librarian, specialist, admin support, and other support FTEs.
Student-teacher ratio (2008-2022): published enrollment denominator and student-teacher ratio.
Teacher educational attainment (2008-2019, 2021-2022): teacher FTE and percent bachelor's, master's, and beyond master's.
Teacher average salary (2008-2024): teacher FTE and average salary.
Entities are state and district. School-level principal salary files are published by NH DOE but are not part of this first staff shipment.
Usage
fetch_staff(
end_year,
tidy = TRUE,
use_cache = TRUE,
source = NULL,
max_age_days = NULL,
refresh = FALSE
)Arguments
- end_year
School year end (e.g., 2024 = 2023-24). Run
get_available_staff_years()to see available years.- tidy
If TRUE (default), returns the long canonical schema (one row per entity x staff_role x metric). If FALSE, returns a wide frame.
- use_cache
If TRUE (default), uses locally cached results when available; set FALSE to force a fresh read from bundled data.
- source
Requested acquisition mode:
"package"(default) or explicit"live"where a runtime producer exists. Retained-only surfaces reject live requests; refresh their files through the documented manual harvest.- max_age_days
Maximum reusable live-cache age in elapsed 24-hour days.
- refresh
Force live retrieval. Valid only in live mode.
Value
Data frame of staff/personnel data. Tidy columns: end_year, district_id, district_name, school_id, school_name, nces_dist, nces_sch, is_state, is_district, is_school, is_charter, staff_role, metric, value, value_type.
Examples
if (FALSE) { # \dontrun{
# Staff/personnel data for the 2023-24 school year
staff <- fetch_staff(2024)
# Statewide teacher average salary
staff |>
dplyr::filter(is_state, metric == "average_salary") |>
dplyr::select(end_year, district_name, value)
# District student-teacher ratios
staff |>
dplyr::filter(is_district, metric == "student_teacher_ratio") |>
dplyr::arrange(value)
# Wide format (metrics as columns)
fetch_staff(2022, tidy = FALSE)
} # }