Fetch special-education data for multiple years
Source:R/fetch_sped.R, R/source_surface_docs.R
fetch_sped_multi.RdFetch special-education data for multiple years
Usage
fetch_sped_multi(
end_years,
tidy = TRUE,
use_cache = TRUE,
source = NULL,
max_age_days = NULL,
refresh = FALSE,
allow_partial = FALSE
)Arguments
- end_years
Vector of school year ends (e.g., 2000:2024).
- tidy
If TRUE (default), returns tidy output.
- use_cache
If TRUE (default), uses locally cached results.
- 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.
- allow_partial
If FALSE (default) the call FAILS CLOSED: any year that cannot be served aborts the whole request, so a short frame is never returned to a caller who did not ask for one. If TRUE, a year that the source genuinely could not serve is dropped with a warning naming it and recorded in the returned frame's
missing_yearsattribute; a package or source-policy refusal is still never dropped.requested_yearsandmissing_yearsare attached in both modes.
Examples
if (FALSE) { # \dontrun{
# Full backbone series
sped <- fetch_sped_multi(2000:2024)
# Autism child-count trend
sped |>
dplyr::filter(disability_category == "autism", subgroup == "total",
is.na(age_group)) |>
dplyr::select(end_year, n_students) |>
dplyr::arrange(end_year)
# Two years
fetch_sped_multi(c(2012, 2023))
} # }