| school_districts {tigris} | R Documentation |
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 |
type |
Specify whether you want to return a unified school district (the default, |
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 2022 |
... |
arguments to be passed to internal function |
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.
Additional Arguments
Additional arguments that can be passed in ... are:
-
classDesired class of return object:"sf"(the default) or"sp". sp classes should be considered deprecated as of tigris version 2.0, but legacy support is still available. -
progress_barIf set toFALSE, do not display download progress bar (helpful for R Markdown documents). Defaults toTRUE. -
keep_zipped_shapefileIf set toTRUE, do not delete zipped shapefile (stored in temporary directory orTIGRIS_CACHE_DIRdepending on the configuration of global option"tigris_use_cache"). Defaults toFALSE. -
refreshWhether to re-download cached shapefiles (TRUEorFALSE) . The default is eitherFALSEor the value of global option"tigris_refresh"if it is set. Specifying this argument will override the behavior set in"tigris_refresh"global option. -
filter_byGeometry used to filter the output returned by the function. Can be an sf object, an object of classbbox, or a length-4 vector of formatc(xmin, ymin, xmax, ymax)that can be converted to a bbox. Geometries that intersect the input tofilter_bywill be returned.
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
## Not run:
library(tigris)
library(leaflet)
schools <- school_districts("Maine")
leaflet(schools) %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(fillColor = "white",
color = "black",
weight = 0.5)
## End(Not run)