6.6 Data sources
The USAboundaries package, https://github.com/ropensci/USAboundaries contains state, county and zip code data for the US.26 As well as current boundaries, it also has state and county boundaries going back to the 1600s.
The tigris package, https://github.com/walkerke/tigris, makes it easy to access the US Census TIGRIS shapefiles.27 It contains state, county, zipcode, and census tract boundaries, as well as many other useful datasets.
The rnaturalearth package28 bundles up the free, high-quality data from http://naturalearthdata.com/. It contains country borders, and borders for the top-level region within each country (e.g. states in the USA, regions in France, counties in the UK).
If you have your own shape files (
.shp) you can load them into R with
Lincoln A. Mullen and Jordan Bratt, “USAboundaries: Historical and Contemporary Boundaries of the United States of America,” Journal of Open Source Software 3, no. 23 (2018): 314, https://doi.org/10.21105/joss.00314.↩︎