- Find data and get it into appropriate format (some manual copying from PDF was needed)
- Calculate statistics needed for mapping (here percent voting for Democrats within county)
- Get geographic (shapefile) data
- Combine stats and geographic data
- Generate choropleth map
This tutorial on creating maps with R and this vignette about tmap package were very helpful.
A quick analysis of the District 9 US House elections over time shows that some counties (e.g., Monroe county) are strong in voting for Democrats and some counties (e.g., Morgan and Orange counties) are much weaker. In 2012 though Orange, Washington, Harrison and some other counties suddenly had nearly half of county voters voting for Democrats. The turnout in 2012 was higher than in 2010, but it was comparable to 2016, when Shelli Yoder was the candidate again. The year of 2012 was also when only two candidates ran, so may be we need to look at other candidates and how they take votes. More data and more analysis needed.