voting_districts: Download a voting districts shapefile into R

View source: R/legislative.R

voting_districtsR Documentation

Download a voting districts shapefile into R

Description

Obtain feature geometry for 2020 voting districts, which align with voting districts for the 2020 PL-94171 redistricting data from the US Census Bureau.

Usage

voting_districts(state = NULL, county = NULL, cb = FALSE, year = 2020, ...)

Arguments

state

The state for which you'd like to retrieve data. Can be a state name, state abbreviation, or FIPS code. When NULL and combined with cb = TRUE, a national dataset of voting districts will be returned.

county

The county for which you are requesting data. Can be a county name or FIPS code. If NULL (the default), data for the entire state will be returned.

cb

If cb is set to TRUE, download a generalized (1:500k) cartographic boundary file. Defaults to FALSE (the most detailed TIGER/Line file).

year

the data year; defaults to 2022

...

arguments to be passed to internal function load_tiger, which is not exported. See Additional Arguments.

Details

The US Census Bureau describes voting districts as follows: Voting district (VTD) is a generic term adopted by the Bureau of the Census to include the wide variety of small polling areas, such as election districts, precincts, or wards, that State and local governments create for the purpose of administering elections. Some States also use groupings of these entities to define their State and local legislative districts, as well as the districts they define for election of members to the U.S. House of Representatives. In a nationwide cooperative program for the 1980 census, the Census Bureau gave States the opportunity to request use of these election precinct boundaries as the boundaries of #' census enumeration districts (EDs) or, in some areas, census blocks.

Support for voting districts in tigris 1.5 and higher is aligned with the 2020 PL redistricting data. The argument cb = FALSE retrieves voting districts from the TIGER/Line PL shapefiles. A generalized version from the cartographic boundary dataset is available with the argument cb = TRUE.

Additional Arguments

Additional arguments that can be passed in ... are:

  • class Desired 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_bar If set to FALSE, do not display download progress bar (helpful for R Markdown documents). Defaults to TRUE.

  • keep_zipped_shapefile If set to TRUE, do not delete zipped shapefile (stored in temporary directory or TIGRIS_CACHE_DIR depending on the configuration of global option "tigris_use_cache"). Defaults to FALSE.

  • refresh Whether to re-download cached shapefiles (TRUE or FALSE) . The default is either FALSE or 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_by Geometry used to filter the output returned by the function. Can be an sf object, an object of class bbox, or a length-4 vector of format c(xmin, ymin, xmax, ymax) that can be converted to a bbox. Geometries that intersect the input to filter_by will be returned.

See Also

https://www2.census.gov/geo/pdfs/reference/GARM/Ch14GARM.pdf

Other legislative district functions: congressional_districts(), state_legislative_districts()

Examples

## Not run: #'
library(tigris)

ia <- voting_districts("Iowa")

plot(ia$geometry)


## End(Not run)

tigris documentation built on May 29, 2024, 2:20 a.m.