Restaurants
The Violations data set in the mdsr package contains information regarding the outcome of health inspections of restaurants in New York City. Use these data to calculate the median violation score by zip code for zip codes in Manhattan with 50 or more inspections. What pattern, if any, do you see between the number of inspections and the median score?
Hint
greaterThan50Zips <-
Violations %>%
select(boro, score, zipcode) %>%
na.omit() %>%
filter(boro == "MANHATTAN") %>%
group_by(zipcode) %>%
summarise(totalInspections = n()) %>%
filter(totalInspections >= "50")This is the code that will get you the number of total inspections per zipcode so you can filter for the ones over 50. Next you have to do a couple of joins to get it all in one table so you can find the median scores. After that, maybe try graphing it to see the pattern.