Understanding census geography and tigris basics

Analyzing US Census Data in R

Kyle Walker

Instructor

TIGER/Line Shapefiles

TIGER/Line logo

Analyzing US Census Data in R

The tigris R package

Functions in the tigris package:

  • Download shapefiles from the Census website
  • Load them into R as spatial objects
Analyzing US Census Data in R

Legal and statistical entities

library(tigris)
az_counties <- counties(state = "AZ")
plot(az_counties)

Arizona counties

Analyzing US Census Data in R

Geographic features

nh_roads <- primary_secondary_roads(state = "NH")
plot(nh_roads)

New Hampshire roads

Analyzing US Census Data in R

tigris and Spatial objects

head(nh_roads@data)
      LINEARID         FULLNAME RTTYP MTFCC
0 110450358068   Hanover St Exd     M S1200
1 110426481978 State Rte 28 Byp     S S1200
2 110426481286     US Hwy 1 Byp     U S1200
3 110426481285     US Hwy 1 Byp     U S1200
4 110408217438 State Rte 28 Byp     S S1200
5 110426481980 State Rte 28 Byp     S S1200
nh_roads@proj4string
CRS arguments:
 +proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0
Analyzing US Census Data in R

Let's practice!

Analyzing US Census Data in R

Preparing Video For Download...