Here is the process I used to create the 2016 presidential election by county map with zero-population blocks removed.
- I obtained US county boundaries and Census block boundaries by state from NHGIS, http://www.nhgis.org, along with Table P1 (Total Population) from the 2010 US Census. Your NHGIS IDs would be different.
- I ran the following R code to walk through every block boundary dataset, identify the no-population blocks, then write out the result as a shapefile:
library(tidyverse)
library(sf)
library(tigris)