Skip to contents

Downloads and processes school directory data from the Idaho State Department of Education (SDE). The directory is derived from the SDE's Enrollment by Building file, which lists every public school building in Idaho with its district, charter status, and grades served.

Usage

fetch_directory(end_year = NULL, tidy = TRUE, use_cache = TRUE)

Arguments

end_year

School year end (e.g., 2026 for 2025-26). If NULL (default), fetches the most recent available year.

tidy

If TRUE (default), returns data in a standardized format with consistent column names and derived fields (grades_served, school_level). If FALSE, returns the raw columns from the SDE file.

use_cache

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

Value

A tibble with school directory data. When tidy = TRUE, columns include:

  • end_year: School year end (e.g., 2026)

  • district_id: SDE district identifier

  • district_name: District or charter organization name

  • building_id: SDE building number

  • building_name: School/building name

  • is_charter: Logical, TRUE for charter schools

  • grades_served: Character string of grades with enrollment (e.g., "K-05")

  • low_grade: Lowest grade served

  • high_grade: Highest grade served

  • school_level: Derived school level ("Elementary", "Middle", "High", "K-8", "K-12", "Other")

  • total_enrollment: Total PK-12 enrollment

Details

The directory data is derived from the Idaho SDE Enrollment by Building file, published on the SDE's Public School Finance page. This file is updated each school year and contains all public and charter school buildings in Idaho.

The school_level field is derived from grade-level enrollment:

  • Elementary: Highest grade is 06 or below

  • Middle: Lowest grade is 06+ and highest is 08 or below

  • High: Lowest grade is 09 or above

  • K-8: Spans elementary and middle (lowest <= 02, highest <= 08)

  • K-12: Spans elementary through high school

  • Other: Does not fit standard patterns (e.g., alternative schools)

For richer directory data including addresses and phone numbers, visit the Idaho Report Card at https://www.idahoreportcard.org/.

Examples

if (FALSE) { # \dontrun{
# Get current school directory
dir_data <- fetch_directory()

# Get raw format (original SDE column names)
dir_raw <- fetch_directory(tidy = FALSE)

# Force fresh download (ignore cache)
dir_fresh <- fetch_directory(use_cache = FALSE)

# Filter to charter schools
library(dplyr)
charters <- dir_data |>
  filter(is_charter)

# Filter to high schools
high_schools <- dir_data |>
  filter(school_level == "High")
} # }