Learn R Programming

⚠️There's a newer version (2.2.1) of this package.Take me there.

tigris

tigris is an R package that allows users to directly download and use TIGER/Line shapefiles (https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html) from the US Census Bureau.

To install the package from CRAN, issue the following command in R:

install.packages('tigris')

Or, get the development version from GitHub:

devtools::install_github('walkerke/tigris')

As of version 1.0 (released in July 2020), tigris functions return simple features objects with a default year of 2019. To get started, choose a function from the table below and use it with a state and/or county if required. You'll get back an sf object for use in your mapping and spatial analysis projects:

library(tigris)
library(ggplot2)

manhattan_roads <- roads("NY", "New York")

ggplot(manhattan_roads) + 
  geom_sf() + 
  theme_void()

tigris only returns feature geometries for US Census data which default to the coordinate reference system NAD 1983 (EPSG: 4269). For US Census demographic data (optionally pre-joined to tigris geometries), try the tidycensus package. For help deciding on an appropriate coordinate reference system for your project, take a look at the crsuggest package.

Updated documentation for tigris is coming later this year in the book Analyzing the US Census with R. In the meantime, I'd recommend the following materials to learn about conceptual foundations of the package:

Available datasets:

Please note: cartographic boundary files in tigris are not available for 2011 and 2012.

FunctionDatasets availableYears available
nation()cartographic (1:5m; 1:20m)2013-2020
divisions()cartographic (1:500k; 1:5m; 1:20m)2013-2020
regions()cartographic (1:500k; 1:5m; 1:20m)2013-2020
states()TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)1990, 2000, 2010-2020
counties()TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)1990, 2000, 2010-2020
tracts()TIGER/Line; cartographic (1:500k)1990, 2000, 2010-2020
block_groups()TIGER/Line; cartographic (1:500k)1990, 2000, 2010-2020
blocks()TIGER/Line2000, 2010-2020
places()TIGER/Line; cartographic (1:500k)2011-2020
pumas()TIGER/Line; cartographic (1:500k)2012-2020
school_districts()TIGER/Line; cartographic2011-2020
zctas()TIGER/Line; cartographic (1:500k)2000, 2010, 2012-2020
congressional_districts()TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011-2020
state_legislative_districts()TIGER/Line; cartographic (1:500k)2011-2020
voting_districts()TIGER/Line2012
area_water()TIGER/Line2011-2020
linear_water()TIGER/Line2011-2020
coastlineTIGER/Line()2013-2020
core_based_statistical_areas()TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011-2020
combined_statistical_areas()TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011-2020
metro_divisions()TIGER/Line2011-2020
new_england()TIGER/Line; cartographic (1:500k)2011-2020
county_subdivisions()TIGER/Line; cartographic (1:500k)2010-2020
urban_areas()TIGER/Line; cartographic (1:500k)2012-2020
primary_roads()TIGER/Line2011-2020
primary_secondary_roads()TIGER/Line2011-2020
roads()TIGER/Line2011-2020
rails()TIGER/Line2011-2020
native_areas()TIGER/Line; cartographic (1:500k)2011-2020
alaska_native_regional_corporations()TIGER/Line; cartographic (1:500k)2011-2020
tribal_block_groups()TIGER/Line2011-2020
tribal_census_tracts()TIGER/Line2011-2020
tribal_subdivisions_national()TIGER/Line2011-2020
landmarks()TIGER/Line2011-2020
military()TIGER/Line2011-2020

Copy Link

Version

Install

install.packages('tigris')

Monthly Downloads

18,250

Version

1.6

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Kyle Walker

Last Published

February 22nd, 2022

Functions in tigris (1.6)

coastline

Download a shapefile of the US coastline into R
block_groups

Download a Census block groups shapefile into R, and optionally subset by county
address_ranges

Download an address range features shapefile into R
call_geolocator_latlon

Call geolocator for one address with lat/lon, adds option to set benchmark and vintage if not provided it will default to the most recent.
blocks

Download a Census block shapefile into R
append_geoid

Retrieve GEOID from the Census Geocoder by address
alaska_native_regional_corporations

Download an Alaska Native Regional Corporation shapefile into R.
area_water

Download an area water shapefile into R
call_geolocator

Call geolocator for one address
combined_statistical_areas

Download a combined statistical areas shapefile into R
counties

Download a US Counties shapefile into R, and optionally subset by state
geo_join

Easily merge a data frame to a spatial data frame
list_states

Return a list of all the states in a state object
rbind_tigris

Row-bind tigris Spatial objects
fips_codes

Dataset with FIPS codes for US states and counties
list_places

Return a list of all the places in a places object
rails

Download a national rails shapefile into R
divisions

Download a US Census divisions cartographic boundary shapefile into R
landmarks

Download a point or area landmarks shapefile into R
military

Download the Military Installation National Shapefile into R
is_tigris

Returns TRUE if obj has a tigris attribute
filter_place

Filter a places Spatial object for only those places matching the contents of the place vector.
core_based_statistical_areas

Download a core-based statistical area shapefile into R
native_areas

Download an American Indian / Alaska Native / Native Hawaiian Areas shapefile into R.
congressional_districts

Download a congressional districts shapefile into R
new_england

Download a New England City and Town Area shapefile into R
tigris_cache_dir

Set the cache directory to store shapefiles with tigris
nation

Download a US national boundary shapefile into R
tigris_type

Get the type of tigris object obj is
filter_state

Filter a states Spatial object for only those states matching the contents of the state vector.
county_subdivisions

Download a county subdivision shapefile into R
linear_water

Download an linear water shapefile into R
tribal_census_tracts

Download a Tribal Census tract shapefile into R.
primary_secondary_roads

Download a primary & secondary roads shapefile into R
grep_place

Find places matching a term in a places object
grep_state

Find states matching a term in a state object
regions

Download a US regions cartographic boundary shapefile into R
tribal_subdivisions_national

Download an American Indian Tribal Subdivision National shapefile into R.
lookup_code

Look up state and county codes
erase_water

Erase water area from an input polygon dataset
places

Download a Census-designated places shapefile into R
metro_divisions

Download a metropolitan divisions shapefile into R.
pumas

Download a Public Use Microdata Area (PUMA) shapefile into R
tribal_block_groups

Download a Tribal block groups shapefile into R.
roads

Download a roads shapefile into R
tracts

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

Return a data frame of county names & FIPS codes for a given state
primary_roads

Download a national primary roads shapefile into R
tigris-exports

tigris exported operators
state_legislative_districts

Download a state legislative districts shapefile into R - upper or lower
shift_geometry

Shift and rescale Alaska, Hawaii, and Puerto Rico in a US-wide sf object
school_districts

Download a school district shapefile into R
urban_areas

Download an urban areas shapefile into R
zctas

Download a Zip Code Tabulation Area (ZCTA) shapefile into R
states

Download shapefile for all states into R
voting_districts

Download a voting districts shapefile into R
tigris

Download and use U.S. Census TIGER shapefiles in R