You can now download certain historical datasets for the US directly within R, using the USABoundaries
package. The code to do so is straightforward. For example, to download a shapefile containing the boundaries of US counties in 1910:
library(sf)
library(USAboundaries)
map <- us_counties(map_date = "1910-01-01", resolution = "high")
st_write(obj = map, dsn = "us-counties-1910.shp")
This writes the four files necessary for an ESRI shapefile in your working directory.
us-counties-1910.dbf
us-counties-1910.shp
us-counties-1910.prj
us-counties-1910.shx
To install the USABoundaries
package, run the following code from within R:
install.packages("USAboundariesData", repos = "http://packages.ropensci.org", dependencies = TRUE)
install.packages("USABoundaries", repos = "http://cran.us.r-project.org", dependencies = TRUE)
You can also plot the shapefile within R, e.g. to verify that it's correct, with plot(st_geometry(map))
:

The shapefile is stored in R as a simple data frame, with a geometry
column that specifies the polygons. This means that you can work with it using standard R techniques, e.g. tidyverse
. If you want only the contiguous United States:
library(sf)
library(USAboundaries)
library(tidyverse)
map <- us_counties(map_date = "1910-01-01", resolution = "high") %>%
filter(state_name != "Alaska" & state_name != "Hawaii")
plot(st_geometry(map))
This produces a map like this:

As an aside, the USABoundaries
package contains boundaries for US states (with the us_states
function) and locations of US cities (with the us_cities
) function. It also includes historical shapefiles for as back as you want. Change the map_date
parameter in the us_counties
function to call to 1750, for example, and you'll get:
