Learn R Programming

tigris (version 1.6)

school_districts: Download a school district shapefile into R

Description

From the US Census Bureau (see link for source): School Districts are single-purpose administrative units within which local officials provide public educational services for the area's residents. The Census Bureau obtains school district boundaries, names, local education agency codes, grade ranges, and school district levels biennially from state education officials. The Census Bureau collects this information for the primary purpose of providing the U.S. Department of Education with annual estimates of the number of children in poverty within each school district, county, and state. This information serves as the basis for the Department of Education to determine the annual allocation of Title I funding to states and school districts.

Usage

school_districts(state = NULL, type = "unified", cb = FALSE, year = NULL, ...)

Arguments

state

The two-digit FIPS code (string) of the state you want. Can also be state name or state abbreviation. When NULL and combined with cb = TRUE, a national dataset of school districts will be returned for years 2019 and later.

type

Specify whether you want to return a unified school district (the default, 'unified'), an elementary school district ('elementary'), or a secondary school district ('secondary'). Please note: elementary and secondary school districts do not exist in all states

cb

if TRUE, download a generalized (1:500k) school districts file. Defaults to FALSE (the most detailed TIGER/Line file)

year

the data year; defaults to 2020

...

arguments to be passed to the underlying `load_tiger` function, which is not exported. Options include class, which can be set to "sf" (the default) or "sp" to request sf or sp class objects, and refresh, which specifies whether or not to re-download shapefiles (defaults to FALSE).

Details

The Census Bureau creates pseudo-unified school districts for areas in which unified school districts do not exist. Additionally, elementary and secondary school districts do not exist in all states. Please see the link for more information on how the Census Bureau creates the school district shapefiles.

See Also

https://www2.census.gov/geo/pdfs/maps-data/data/tiger/tgrshp2020/TGRSHP2020_TechDoc.pdf

Other general area functions: block_groups(), blocks(), counties(), county_subdivisions(), places(), pumas(), states(), tracts(), zctas()

Examples

Run this code
# NOT RUN {
library(tigris)
library(leaflet)

schools <- school_districts("Maine")

leaflet(schools) %>%
  addProviderTiles("CartoDB.Positron") %>%
  addPolygons(fillColor = "white",
              color = "black",
              weight = 0.5)
# }

Run the code above in your browser using DataLab