![]() Here's the output of the dput: dput(obesity_map) I'm fairly new to this so I'd appreciate any and all help! But what I really want is something like this below but with each county filled in: Ggplot(map.county, aes(x = long, y = lat, group=group, fill=as.factor(value))) + geom_polygon(colour = "white", size = 0.1)Īnd it basically creates an image that looks like this:Īs you can see, the US is divided into strange shapes, the colors aren't one consistent color in varying gradients, and you can't make much from it. Map.county <- merge(county.obesity, map.county, all=TRUE) Map.data <- map.dataĬounty.obesity <- ame(region = obesity_map$state, subregion = obesity_map$county, value = obesity_map$obesity_rate) Map.data <- merge(us.state.map, df, by='region', all=T) States <- levels(as.factor(us.state.map$region))ĭf <- ame(region = states, value = runif(length(states), min=0, max=100),stringsAsFactors = FALSE) I'm trying to visualize this on the map by showing various obesity rates per county throughout the US with this: us.state.map <- map_data('state') It looks more or less like this: obesity_map = ame(state, county, obesity_rate)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |