Skip to contents

Downloads and processes graduation rate data from the Texas Education Agency Completion, Graduation, and Dropout portal. Provides four-year longitudinal graduation rates for the Class of 2003-2024.

Usage

fetch_grad(class_year, tidy = TRUE, use_cache = TRUE)

Arguments

class_year

A class year (e.g., 2024 for Class of 2024). Valid values: 2003-2024.

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 TEA.

Value

Data frame with graduation rate data. Wide format includes columns for district/campus IDs and graduation rates by subgroup. Tidy format pivots these rates into a subgroup column.

Examples

if (FALSE) { # \dontrun{
# Get 2024 graduation rates (Class of 2024)
grad_2024 <- fetch_grad(2024)

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

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

# Filter to specific district
austin_isd <- grad_2024 |>
  dplyr::filter(district_id == "101912")

# Compare state and district rates
grad_2024 |>
  dplyr::filter(type %in% c("State", "District")) |>
  dplyr::select(district_name, subgroup, grad_rate)
} # }