![]() Mutate(NAME = gsub(" County", "", County)) %>% Scale_fill_gradientn(colours = rev(rainbow(7)), Geom_polygon(color = "black", fill = NA) + Geom_polygon(aes(fill = Frequencies), color = "white") + Geom_polygon(color = "black", fill = "gray") Pen_base <- ggplot(data = Pennsylvania_final, mapping = aes(x = long, y = lat, group = subregion)) + Pennsylvania_final <- inner_join(Pennsylvania, License_final,by=c('subregion' = 'County_join')) ![]() Pennsylvania <- map_data("county","Pennsylvania") ![]() Group_by(County_join) %>% summarise(Frequencies = n()) Mutate(County_join = tolower(str_remove_all(County, " County"))) %>% How do I convert this to colored choropleth heat map of frequencies? "susquehanna", "tioga", "union", "venango", "warren", "washington", "pike", "potter", "schuylkill", "snyder", "somerset", "sullivan", "montour", "northampton", "northumberland", "perry", "philadelphia", "lycoming", "mckean", "mercer", "mifflin", "monroe", "montgomery", "lackawanna", "lancaster", "lawrence", "lebanon", "lehigh", "luzerne", "fulton", "greene", "huntingdon", "indiana", "jefferson", "juniata", "dauphin", "delaware", "elk", "erie", "fayette", "forest", "franklin", "clearfield", "clinton", "columbia", "crawford", "cumberland", "cambria", "cameron", "carbon", "centre", "chester", "clarion", "beaver", "bedford", "berks", "blair", "bradford", "bucks", "butler", The output of dput(Frequency) is as follows: Frequency <- structure(list(County_join = c("adams", "allegheny", "armstrong", Using this dataset, I have created a summary table of the number of points per counties. I am using the map library of R: require(maps) Now, I want to create a heat map with the frequencies. ![]() I have a dataset with Pennsylvania counties(67) and the frequency of each county.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |