Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How do I create a heat map of the US using plot_usmap

$
0
0

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 a state or fips column.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>