Fetch New Hampshire graduation rate data
Source:R/fetch_graduation.R, R/source_surface_docs.R
fetch_graduation.RdDownloads and processes 4-year adjusted cohort graduation rate (ACGR) data from the New Hampshire Department of Education iPlatform. Data includes school-level cohort counts, graduate counts, and graduation rates.
Usage
fetch_graduation(
end_year,
tidy = TRUE,
use_cache = TRUE,
source = NULL,
max_age_days = NULL,
refresh = FALSE
)Arguments
- end_year
School year end / class year. Year is the end of the academic year - e.g., 2024 for Class of 2024 (2023-24 school year). Run
get_available_grad_years()to see available years.- tidy
If TRUE (default), returns data in tidy format with standard column names. If FALSE, returns processed data closer to source format.
- use_cache
If TRUE (default), uses locally cached data when available. Set to FALSE to force re-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 with graduation rate data including columns: end_year, type, district_id, district_name, school_id, school_name, subgroup, grad_rate, cohort_count, graduate_count, is_state, is_district, is_school.
Examples
if (FALSE) { # \dontrun{
# Get 2024 graduation rates (Class of 2024)
grad_2024 <- fetch_graduation(2024)
# Check available years
get_available_grad_years()
# Filter to state level
state <- grad_2024 |>
dplyr::filter(is_state, subgroup == "all")
# Filter to specific district
manchester <- grad_2024 |>
dplyr::filter(grepl("Manchester", district_name), subgroup == "all")
# Force fresh read (ignore cache)
grad_fresh <- fetch_graduation(2024, use_cache = FALSE)
} # }