I'm new to R so bear with me here. I have essentially recreated the 2016 electoral map with resulting data that I joined from various data frames.
I tried to introduce more arguments to my aes
in geom_polygon
, all of which seem to warp the map to a different appearance or introduce a new legend. Is there a way I can change the legend to not be of a scale, but of discrete information? I think the Blue
column would be useful because it is boolean in nature with 1
representing that Clinton won that state and 0
indicating Trump won that state.
ggplot(data=states_w_votes) +
geom_polygon(aes(x=long, y=lat, group=group, fill=Blue)) +
scale_fill_gradient(low="red", high="blue") +
coord_quickmap()