In the Words of the Strawberry Alarm Clock

β€œTo divide this cockeyed world in two
Throw your pride to one side, it’s the least you can do
Beatniks and politics, nothing is new
A yardstick for lunatics, one point of view

β€œWho cares what games we choose
Little to win, but nothing to lose”

– Strawberry Alarm Clock

Need a quick Census TIGER/Line Shapefile for a map you are making? πŸ—Ί

Need a quick Census TIGER/Line Shapefile for a map you are making? πŸ—Ί

It is super easy to get using R and tigris and sf libraries. I often will run a command like this in R terminal to get a Shapefile of the of the counties in Maine.

library(sf)
library(tigris)

counties(β€˜me’, cb=T) %>% write_sf(β€˜/tmp/maine.shp’)

Other common tigris functions I will use is state, county_subdivision, tract, block_group and school_districts which work similarly. A resolution parameter can be supplied to control the resolution downloaded, the cb=T flag obtains cartographic boundaries which follow coast lines, rather then actual boundaries.