Fetch New Hampshire chronic absenteeism data
Source:R/fetch_absence.R, R/source_surface_docs.R
fetch_absence.RdLoads and processes chronic absenteeism data from the New Hampshire
Department of Education. Data is read from bundled CSV files in
inst/extdata/absence/.
Usage
fetch_absence(
end_year,
tidy = TRUE,
use_cache = TRUE,
source = NULL,
max_age_days = NULL,
refresh = FALSE
)Arguments
- end_year
School year end (e.g., 2024 for 2023-24). Use
get_absence_years()to see available years.- tidy
If TRUE (default), returns long format with entity flags. If FALSE, returns processed data without entity flags.
- use_cache
If TRUE (default), uses locally cached data when available. Set to FALSE to force re-read from bundled CSV files.
- 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 chronic absenteeism data. Columns include:
- end_year
School year end (integer)
- type
"State", "District", or "School"
- district_id
NH district identifier
- district_name
District name
- school_id
NH school identifier
- school_name
School name
- subgroup
Student subgroup (standard names: total, white, black, hispanic, native_american, asian, pacific_islander, multiracial, male, female, econ_disadv, free_reduced_lunch, special_ed, lep)
- n_enrolled
Number of students enrolled in subgroup
- n_chronically_absent
Number chronically absent (10%+ days missed)
- pct_chronically_absent
Chronic absenteeism rate (0-100)
- is_state
TRUE for state-level aggregates (tidy only)
- is_district
TRUE for district-level records (tidy only)
- is_school
TRUE for school-level records (tidy only)
Details
NH does not currently publish chronic absenteeism data. New Hampshire is the only US state that does not monitor chronic absenteeism. The NH DOE iPlatform publishes only attendance rates (percent of half-days attended), at the district level only.
This function is fully implemented and will work when/if NH begins publishing chronic absenteeism data and CSV files are bundled in the package. Until then, it returns an error explaining the limitation.
For attendance rate data, visit https://my.doe.nh.gov/iPlatform/.
Examples
if (FALSE) { # \dontrun{
# Get 2024 chronic absenteeism data (2023-24 school year)
absence_2024 <- fetch_absence(2024)
# State-level total chronic absenteeism rate
absence_2024 |>
dplyr::filter(is_state, subgroup == "total") |>
dplyr::select(end_year, pct_chronically_absent)
# Get wide format (no entity flags)
absence_wide <- fetch_absence(2024, tidy = FALSE)
} # }