I have plotted a figure of the US states in R.
Here is the very simple code:
library(usmap)
library(ggplot2)
plot_usmap(region = 'states')
And here is the resulting figure: Figure of US states in R - states are not colored
Furthermore, I have a csv file containing the names of the states in US, and a color value, equal to red if that state voted for Republicans or blue if the state voted for Democrats. This is the top 5 rows of the CSV file:
State | Color |
---|---|
Alabama | #E81B23 |
Alaska | #E81B23 |
Arizona | #1405bd |
Arkansas | #E81B23 |
How can I fill the states of my figure based on the colors in the CSV file?