keep getting this error, not sure what I am doing incorrectly, tried using fill=factor()
but that didn't work either, any help is greatly appreciated.
Storing data
map <- map_data("state")
map
Creating map
map.simple <- ggplot() + geom_map(data=map,aes(x=map$long,y=map$lat,map_id=region),map=map,fill="white", color="black")
map.simple
Creating map with average income in each state
map.income <- map.simple + geom_map(data=Final.income, map=map,aes(fill=as.factor(avgmedian),map_id=State),color="black",na.rm=TRUE)
map.income