Created
February 6, 2017 00:18
-
-
Save yvlau92/d326a2d3ec129f68c0795835ad7246a7 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
# n_infractions: numbers of infractions committed at a particular date of inspection | |
closure_n_infractions <- closure %>% | |
group_by(camis,date) %>% | |
summarise(n_infractions = n())%>% | |
arrange(desc(n_infractions)) | |
# n_closures: number of closures a restaurant has had within the past 5 years. | |
closure_n_closures <- closure_n_infractions %>% | |
group_by(camis)%>% | |
summarise(n_closures = n())%>% | |
arrange(desc(n_closures)) | |
# days_diff: number of days a restaurant took to reopen after being closed by the Health Department | |
dates_diff <- overall_unique_closed_noreclose %>% | |
group_by(camis)%>% | |
mutate(days_diff = date[action=='closed'][1] - date[action=='reopened'][1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment