Load Census TIGER/Line Shapefiles into R

Download TIGER/Line shapefiles from the United States Census Bureau and load into R as 'SpatialDataFrame' or 'sf' objects.


Download and use Census TIGER/Line shapefiles in R

CRAN version: 0.3 (updated 16 May 2016)

Dev version: 0.3.3.9000 (updated 5 July 2016)

tigris is an R package that allows users to directly download and use TIGER/Line shapefiles (https://www.census.gov/geo/maps-data/data/tiger-line.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')

In Version 0.3.3:

  • tigris now accommodates county name changes in the 2015 TIGER/Line dataset. Shannon County, SD (FIPS code 113) is now Oglala Lakota County (FIPS code 102), and Wade Hampton Census Area, AK (FIPS code 270) is now Kusilvak Census Area (FIPS code 158).

  • We fixed a bug that would counties not to load in non-interactive mode.

For more information on how to use this package, please view the RPubs at http://rpubs.com/walkerke/tigris01.

Basic usage:

library(tigris)
 
# Basic plot of US urbanized areas
 
ua <- urban_areas(cb = TRUE)
 
plot(ua)
 

# Interactive Leaflet map (requires the leaflet R package)
 
library(leaflet)
 
ua %>% leaflet() %>% addTiles() %>% addPolygons(popup = ~NAME10)
 

Available datasets:

Please note: cartographic boundary files in tigris are only available going back to 2013.

FunctionDatasets availableYears available
nationcartographic (1:5m; 1:20m)2013, 2014, 2015
divisionscartographic (1:500k; 1:5m; 1:20m)2013, 2014, 2015
regionscartographic (1:500k; 1:5m; 1:20m)2013, 2014, 2015
statesTIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011, 2012, 2013, 2014, 2015
countiesTIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011, 2012, 2013, 2014, 2015
tractsTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
block_groupsTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
blocksTIGER/Line2011, 2012, 2013, 2014, 2015
placesTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
pumasTIGER/Line; cartographic (1:500k)2012, 2013, 2014, 2015
school_districtsTIGER/Line2011, 2012, 2013, 2014, 2015
zctasTIGER/Line; cartographic (1:500k)2012, 2013, 2014, 2015
congressional_districts (114th Congress)TIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2014, 2015
state_legislative_districtsTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
voting_districtsTIGER/Line2012
area_waterTIGER/Line2011, 2012, 2013, 2014, 2015
linear_waterTIGER/Line2011, 2012, 2013, 2014, 2015
coastlineTIGER/Line2013, 2014, 2015
core_based_statistical_areasTIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011, 2012, 2013, 2014, 2015
combined_statistical_areasTIGER/Line; cartographic (1:500k; 1:5m; 1:20m)2011, 2012, 2013, 2014, 2015
metro_divisionsTIGER/Line2011, 2012, 2013, 2014, 2015
new_englandTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
county_subdivisionsTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
urban_areasTIGER/Line; cartographic (1:500k)2012, 2013, 2014, 2015
primary_roadsTIGER/Line2011, 2012, 2013, 2014, 2015
primary_secondary_roadsTIGER/Line2011, 2012, 2013, 2014, 2015
roadsTIGER/Line2011, 2012, 2013, 2014, 2015
railsTIGER/Line2011, 2012, 2013, 2014, 2015
native_areasTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
alaska_native_regional_corporationsTIGER/Line; cartographic (1:500k)2011, 2012, 2013, 2014, 2015
tribal_block_groupsTIGER/Line2011, 2012, 2013, 2014, 2015
tribal_census_tractsTIGER/Line2011, 2012, 2013, 2014, 2015
tribal_subdivisions_nationalTIGER/Line2011, 2012, 2013, 2014, 2015
landmarksTIGER/Line2011, 2012, 2013, 2014, 2015
militaryTIGER/Line2011, 2012, 2013, 2014, 2015

News

  • tigris now accommodates county name changes in the 2015 TIGER/Line dataset. Shannon County, SD (FIPS code 113) is now Oglala Lakota County (FIPS code 102), and Wade Hampton Census Area, AK (FIPS code 270) is now Kusilvak Census Area (FIPS code 158).

  • fixed a bug that would counties not to load in non-interactive mode

  • tigris now defaults to the 2015 TIGER/Line shapefiles and cartographic boundary shapefiles, the most recent shapefiles available from the US Census Bureau.
  • New function, voting_districts(), enables users to retrieve voting district (electoral precinct) shapefiles from the 2012 TIGER/Line dataset.

  • tigris now imports and re-exports the plot() function from the sp package so that Census shapefiles can be plotted without having to load sp explicitly.

  • Enhancements to the geo_join function to merge tabular data frames to spatial data frames. An optional parameter, by, allows you to supply one column name to merge on if the column names are the same.

  • geo_join also accommodates inner joins as well. By supplying 'inner' to the new how parameter, the resultant spatial data frame will retain only those rows that match the target tabular data frame.

  • Various improvements and bug fixes.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("tigris")

0.5.3 by Kyle Walker, 4 months ago


https://github.com/walkerke/tigris


Report a bug at https://github.com/walkerke/tigris/issues


Browse source code at https://github.com/cran/tigris


Authors: Kyle Walker [aut, cre], Bob Rudis [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports stringr, magrittr, rgdal, rgeos, sp, utils, rappdirs, maptools, httr, uuid, sf, dplyr

Suggests acs, testthat, ggplot2, ggthemes, leaflet, knitr


Imported by choroplethr, countyweather, tidycensus.

Suggested by blscrapeR, stormwindmodel, synthACS.


See at CRAN