Created
October 24, 2016 04:44
-
-
Save yeere91/9845743d6701b7c44d790715d1bbf845 to your computer and use it in GitHub Desktop.
This file contains 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
# Summarizing the data by year | |
crashes_in_2015 = zip_counts %>% filter(year==2015) | |
crashes_in_2014 = zip_counts %>% filter(year==2014) | |
crashes_in_2013 = zip_counts %>% filter(year==2013) | |
## Get the diffs for 2014 vs 2015 | |
y2015.vs.y2014 = left_join(crashes_in_2015,crashes_in_2014,by = 'region') | |
df20152014 = as.data.frame(y2015.vs.y2014) %>% select(year.x,region,value.x,value.y) | |
df20152014 = df20152014 %>% mutate(value=value.x-value.y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment