I would like to create visual maps of congressional districts within R. I would like to give it data on the number of people voting in each district and make a heat map by district as a visual via R.
Here are some generic examples of state maps divided by congressional district (without voting data or a heat map) but I would want to create a fairly minimalistic map to plot off of so these are similar in feel to what I want to create:
Here is some sample code for a base map in R, outlining the congressional districts:
library(USAboundariesData) # Needed for us_congressional()
library(sf) # Needed for st_geometry()
mn_congressional <- us_congressional(states = "Minnesota", resolution = "high")
plot(st_geometry(mn_congressional))
However, I now want to incorporate this with a column of voting totals for each of the districts and color the district sections in this map as a heat map?