Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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
You can’t perform that action at this time.