Last active
August 7, 2016 00:31
-
-
Save andrewbtran/6b6244b571cd09130db73954763c8160 to your computer and use it in GitHub Desktop.
Making a choropleth of stops in Hamden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Join the by_tract points to polygon dataframe to the original census tracts dataframe | |
total_map <- left_join(towntracts, by_tract) | |
require(ggmap) | |
require(scales) | |
tm_ct <- ggplot() + | |
geom_polygon(data = total_map, aes(x=long, y=lat, group=group, fill=total), color = "black", size=0.2) + | |
geom_polygon(data = total_map, aes(x=long, y=lat, group=group, fill=total), color = "black", size=0.2) + | |
coord_map() + | |
scale_fill_distiller(type="seq", trans="reverse", palette = "Reds", breaks=pretty_breaks(n=10)) + | |
theme_nothing(legend=TRUE) + | |
labs(title="Where Hamden police conduct traffic stops", fill="") | |
print(tm_ct) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment