Skip to contents

Downloads and processes graduation rate data from the California Department of Education (CDE) School Dashboard.

Usage

fetch_graduation(end_year, tidy = TRUE, use_cache = TRUE)

Arguments

end_year

A school year. Year is the end of the academic year - eg 2023-24 school year is year '2024'. Valid values are 2018-2025.

tidy

If TRUE (default), returns data in long (tidy) format with subgroup column. If FALSE, returns wide format.

use_cache

If TRUE (default), uses locally cached data when available. Set to FALSE to force re-download from CDE.

Value

Data frame with graduation rate data. Includes columns for end_year, type, district_id, district_name, school_id, school_name, subgroup, metric, grad_rate, cohort_count, graduate_count, is_state, is_district, is_school.

Examples

if (FALSE) { # \dontrun{
# Get 2024 graduation data (2023-24 school year)
grad_2024 <- fetch_graduation(2024)

# Get historical data from 2018
grad_2018 <- fetch_graduation(2018)

# Get wide format
grad_wide <- fetch_graduation(2024, tidy = FALSE)

# Force fresh download (ignore cache)
grad_fresh <- fetch_graduation(2024, use_cache = FALSE)

# Filter to LA Unified schools
lausd <- grad_2024 |>
  dplyr::filter(district_name == "Los Angeles Unified")

# Compare district rates
grad_2024 |>
  dplyr::filter(is_district, subgroup == "all") |>
  dplyr::select(district_name, grad_rate, cohort_count) |>
  dplyr::arrange(dplyr::desc(grad_rate))
} # }