tracts: Download a Census tracts shapefile into R, and optionally...

View source: R/enumeration_units.R

tractsR Documentation

Download a Census tracts shapefile into R, and optionally subset by county


Description from the US Census Bureau (see link for source): Census Tracts are small, relatively permanent statistical subdivisions of a county or equivalent entity that are updated by local participants prior to each decennial census as part of the Census Bureau's Participant Statistical Areas Program. The Census Bureau delineates census tracts in situations where no local participant existed or where state, local, or tribal governments declined to participate. The primary purpose of census tracts is to provide a stable set of geographic units for the presentation of statistical data.


tracts(state = NULL, county = NULL, cb = FALSE, year = NULL, ...)



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 Census tracts will be returned for years 2019 and later.


The three-digit FIPS code (string) of the county you'd like to subset for, or a vector of FIPS codes if you desire multiple counties. Can also be a county name or vector of names.


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


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).


Census tracts generally have a population size between 1,200 and 8,000 people, with an optimum size of 4,000 people. A census tract usually covers a contiguous area; however, the spatial size of census tracts varies widely depending on the density of settlement. Census tract boundaries are delineated with the intention of being maintained over a long time so that statistical comparisons can be made from census to census. Census tracts occasionally are split due to population growth or merged as a result of substantial population decline.

Census tract boundaries generally follow visible and identifiable features. They may follow nonvisible legal boundaries, such as minor civil division (MCD) or incorporated place boundaries in some states and situations, to allow for census-tract-to-governmental-unit relationships where the governmental boundaries tend to remain unchanged between censuses. State and county boundaries always are census tract boundaries in the standard census geographic hierarchy.

See Also

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


## Not run: 

tarrant <- tracts("TX", "Tarrant", cb = TRUE)

leaflet(tarrant) %>%
  addTiles() %>%
  addPolygons(popup = ~NAME)

## End(Not run)

tigris documentation built on March 18, 2022, 5:16 p.m.