Library overview

Quick glossary of useful spatial libraries–examples will follow below.

sfis the key R library for spatial R. You’ll likely always want to load whenever doing mapping + spatial analysis

For pulling in census geometries directly from R, tigris is extremely useful. tidycensus is less straightforward to use, but can pull census estimates from decennial/ACS as well as geometries (although it has some limitations that can be annoying)

For cleaning + manipulating spatial data, rmapshaper and lwgeom are also both worth noting.

You might see references to sp and a host of other libraries on stackoverflow and elsewhere–sp provided some similar functionalities but is rapidly getting displaced by sf. I recommend trying to avoid older libraries that are falling out of favor. sf is really easy and good and it is gaining popularity f