Skip to contents

Downloads and processes school directory data from the Alaska Department of Commerce, Community & Economic Development (DCCED) ArcGIS REST API. Data is assembled from 4 ArcGIS layers: school enrollment view (base info), Alaska schools (addresses and type flags), district contacts (superintendent info), and school contacts (principal info).

Usage

fetch_directory(tidy = TRUE, include_closed = FALSE, use_cache = TRUE)

Arguments

tidy

If TRUE (default), returns data in a standardized format with consistent column names. If FALSE, returns raw column names from the API.

include_closed

If FALSE (default), excludes schools marked as closed. Set to TRUE to include all schools regardless of status.

use_cache

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

Value

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

school_number

DEED school identifier (5-digit number)

school_name

School name

school_alias

School alias/alternate name (from Layer B)

entity_id

DCCED entity identifier (from Layer B)

district_id

DEED district identifier

district_name

School district name

district_type

Type of district (Borough, City School District, REAA)

community

Community where the school is located

state

State (always "AK")

physical_address

School street address (from Layer B)

physical_city

School city (from Layer B)

physical_zip

School ZIP code (from Layer B)

mailing_address

School mailing address (from Layer D)

mailing_city

School mailing city (from Layer D)

mailing_state

School mailing state (from Layer D)

mailing_zip

School mailing ZIP code (from Layer D)

is_open

TRUE if school is currently operating

is_charter

TRUE if charter school (from Layer B)

is_correspondence

TRUE if correspondence school (from Layer B)

is_vocational

TRUE if vocational education school (from Layer B)

is_special_ed

TRUE if special education school (from Layer B)

is_alternative

TRUE if alternative program (from Layer B)

is_virtual

TRUE if virtual school (from Layer B)

is_magnet

TRUE if magnet school (from Layer B)

is_state_run

TRUE if state-run school (from Layer B)

is_youth_facility

TRUE if youth facility school (from Layer B)

superintendent_first_name

District superintendent first name (from Layer C)

superintendent_last_name

District superintendent last name (from Layer C)

superintendent_email

District superintendent email (from Layer C)

superintendent_phone

District superintendent phone (from Layer C)

contact_title

School contact title, e.g. Principal (from Layer D)

contact_first_name

School contact first name (from Layer D)

contact_last_name

School contact last name (from Layer D)

contact_phone

School contact phone (from Layer D)

contact_email

School contact email (from Layer D)

school_email

School general email (from Layer D)

latitude

Geographic latitude

longitude

Geographic longitude

website

District website URL

Details

The data includes all Alaska public schools and districts with community locations, district types (Borough, City School District, REAA), websites, open/closed status, geographic coordinates, physical and mailing addresses, school type flags (charter, virtual, magnet, etc.), superintendent info, and school contact info.

The directory data is assembled from four DCCED ArcGIS REST API layers:

  1. School Enrollment View (Layer A): Base school data with names, districts, communities, types, websites, closure status, and geographic coordinates.

  2. Alaska Schools (Layer B): Detailed school attributes including physical addresses, school type flags (charter, virtual, magnet, etc.), alias names, and entity IDs.

  3. District Contacts (Layer C): District-level contact information including superintendent name, email, phone, and mailing address. This data is repeated for all schools in a district.

  4. School Contacts (Layer D): School-level contact information including principal/contact name, email, phone, and mailing address.

If a supplementary layer (B, C, or D) fails to download, a warning is issued but the function returns base data with NA columns for the missing layer.

Alaska organizes schools into approximately 54 districts, which include:

  • Borough school districts (organized boroughs)

  • City school districts (independent cities)

  • Regional Education Attendance Areas (REAAs, in unorganized boroughs)

  • Mt. Edgecumbe (state-run boarding school)

Examples

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

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

# Include closed schools
all_schools <- fetch_directory(include_closed = TRUE)

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

# Filter to a specific district
library(dplyr)
anchorage <- dir_data |>
  filter(district_name == "Anchorage School District")

# Find all charter schools
charters <- dir_data |>
  filter(is_charter)

# Get superintendent contact info for a district
dir_data |>
  filter(district_name == "Anchorage School District") |>
  select(district_name, superintendent_first_name,
         superintendent_last_name, superintendent_email) |>
  distinct()
} # }