Skip to content

Instantly share code, notes, and snippets.

@abkosar
Created April 29, 2016 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abkosar/ce53156d8bcd8710aee9e0f2de8ca197 to your computer and use it in GitHub Desktop.
Save abkosar/ce53156d8bcd8710aee9e0f2de8ca197 to your computer and use it in GitHub Desktop.
#############TOTAL CYCLISTS KILLED IN COLLISIONS BY BOROUGH FOR EACH YEAR#############
Cyclist_Deaths_Years <- by_borough %>% summarise(Total_Cyclist_Killed = sum(NUMBER.OF.CYCLIST.KILLED))
Total_Cyclists_Killed_by_Years = ggplot(data = Cyclist_Deaths_Years, aes(x = Year, y = Total_Cyclist_Killed)) +
geom_bar(aes(fill = BOROUGH), position = "dodge", stat = 'identity') +
theme_economist() +
theme(legend.position = "right") +
theme(legend.text=element_text(size=10)) +
ggtitle('Total Cyclists Killed in Collisions by Year\n(From 07/2012 to 03/2016)') +
ylab("Number of Cyclist Deaths\n") +
xlab("\nYear") +
scale_fill_brewer(palette = "Blues") +
theme(axis.text.x = element_text(angle = 0, hjust = 0))
Total_Cyclists_Killed_by_Years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment