Skip to contents

Downloads and extracts days absent statistics from the SPR database. This includes percentage distributions of students by absence ranges.

Usage

fetch_days_absent(end_year, level = "school")

Arguments

end_year

A school year (2017-2025). Year is the end of the academic year - eg 2020-21 school year is end_year '2021'.

level

One of "school" or "district". "school" returns school-level data, "district" returns district and state-level data.

Value

Data frame with days absent statistics including:

  • end_year, county_id, county_name, district_id, district_name

  • school_id, school_name (for school-level data)

  • Percentage distribution columns: `0 `7 `20

  • Aggregation flags (is_state, is_county, is_district, is_school, is_charter)

The output carries separate day-count and percent-of-days bands, with character NA where a band was not published. Day-count bands are published in 2017-2023; abs_15_plus is the printed 2017 "15+" band, whereas abs_over_15 is the later "over 15" band. Percent-of-days bands are published in 2024-2025. The first nonzero band retains separate names for the printed greater-than-zero lower bound in 2024 and 0.1 lower bound in 2025. These are different measures and boundaries, not interchangeable bands. The 2020 workbook does not publish this sheet and is rejected. The redundant school_year is filtered to the requested year and removed.

Examples

if (FALSE) { # \dontrun{
# Get school-level days absent distribution
days <- fetch_days_absent(2024)

# View absence distribution for a specific school
days %>%
  filter(school_id == "030") %>%
  select(school_name, `0% Absences`, `20% or higher`)
} # }