I am trying to plot points on a US map in a density dot format where the dot for each zip code is sized based on how many people are a certain profession in that zip code. I have gotten very close to what I need, but am struggling to get the coordinates for Alaska and Hawaii where they need to be on an inset map. The first set of code here is what I have.
loc_full2 %>% filter(cns2!=0) %>% ggplot() +
geom_polygon(data=fifty_states, aes(x=long, y=lat, group = group),color="black", fill="white" ) +
geom_point(aes(x=lng, y=lat, size = cns2),alpha=.3,col="grey10") +
scale_size_continuous(range=c(1,10))+
scale_size(name="", range = c(2, 10)) +
guides(size=guide_legend("# CNM")) +
#theme_void()
I have seen in this post (Relocating Alaska and Hawaii on thematic map of the USA with ggplot2) W. Murphy has a simple answer to get the information in the right spot for a choropleth map, but unfortunately, I need to use zipcodes and dots instead of just coloring.
The files I am working with are not shape files, but rather simple csv files with the columns 'zip code', 'state', 'lat', 'long', and 'count' and then I was using the fifty_states function from the fiftystater package to create the map of the country.
The other thing is that I can't seem to correct the legend scale to be integers instead of having decimal places.
This is what I have:
Thank you for any help!