Alaska and Hawaii do not correctly format Horoplet County map in R

I am trying to format the Choropleth Map of the United States to a specific color and, unfortunately, when using scale_fill_brewer to change the color; only 48 states (Hawaii and Alaska do not). Can I find out if I can paint in Hawaii and Alaska?

 library(choroplethr) library(choroplethrMaps) library(ggplot2) data(df_pop_county) county_choropleth(df_pop_county, title = "Title1", legend = "Top 20% of Index", num_colors = 9) + geom_polygon(aes(fill=value), color="white") + scale_fill_brewer(name="Top Index", palette="YlOrRd") 
+5
source share
1 answer

To use this option and update it correctly, we can work with it as an R6 object as follows:

 library(choroplethr) library(choroplethrMaps) library(ggplot2) data(df_pop_county) choro = CountyChoropleth$new(df_pop_county) choro$title = "2012 Population Estimates" choro$ggplot_scale = scale_fill_brewer(name="Population", palette=2, drop=FALSE) choro$render() 

enter image description here

Using the specific pallet you mentioned:

 choro = CountyChoropleth$new(df_pop_county) choro$title = "2012 Population Estimates" choro$ggplot_scale = scale_fill_brewer(name="Population", palette="YlOrRd", drop=FALSE) choro$render() 

enter image description here

+4
source

All Articles