Convenience wrapper that calls fetch_absence() for each year and
binds the results. Skips years that fail (e.g., COVID gap 2020-2021) with
a warning.
Usage
fetch_absence_multi(
end_years,
level = "school",
type = "chronic",
tidy = TRUE,
use_cache = TRUE
)Examples
if (FALSE) { # \dontrun{
# Get all available years of chronic absenteeism
ca_all <- fetch_absence_multi(2017:2024)
# COVID gap: 2020-2021 were not reported, will be skipped with a warning
ca_all <- fetch_absence_multi(2017:2024)
# Multi-year trend by district
library(dplyr)
ca_all %>%
filter(subgroup == "total", is_state) %>%
select(end_year, chronically_absent_rate)
} # }