I am interested in creating a heat map of the US based on a fitness score. My data has 3 columns: a rank column, a state name column where states are abbreviated into FIPS codes, and a fitness score column. The rank and fitness scores are numeric. I'm trying to create a heat map using "plot_usmap". I keep getting stuck here:
plot_usmap(data = fattest_us_states_around, values = "Total Score")+
scale_fill_continuous(low = "blue", high = "red", name = "Fat Score", label = scales::comma)+
theme(legend.position = "right")
This produces the following error message:
Error in map_with_data(data, values = values, include = include, exclude = exclude) :
data
must be a data.frame containing either astate
orfips
column.