Skip to content

Instantly share code, notes, and snippets.

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