Skip to content

Instantly share code, notes, and snippets.

@abkosar
Created April 29, 2016 21:12
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/443d889392a8f33be64b39a3deedd729 to your computer and use it in GitHub Desktop.
Save abkosar/443d889392a8f33be64b39a3deedd729 to your computer and use it in GitHub Desktop.
#############TOTAL MOTORISTS KILLED IN COLLISIONS BY BOROUGH FOR EACH YEAR#############
Motorist_Deaths_Years <- by_borough %>% summarise(Total_Motorist_Killed = sum(NUMBER.OF.MOTORIST.KILLED))
Total_Motorists_Killed_by_Years = ggplot(data = Motorist_Deaths_Years, aes(x = Year, y = Total_Motorist_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 Motorists Killed in Collisions by Year\n(From 07/2012 to 03/2016)') +
ylab("Number of Motorist Deaths\n") +
xlab("\nYear") +
scale_fill_brewer(palette = "Blues") +
theme(axis.text.x = element_text(angle = 0, hjust = 0.5))
Total_Motorists_Killed_by_Years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment