Last active
October 1, 2019 15:38
-
-
Save ajstewartlang/0dc66c9e9abf1f5f12ba2a7e16b501ee to your computer and use it in GitHub Desktop.
Tidy_Tuesday_2019_10_01 - Greenwich Village and Soho Top 5 Pizza Restaurants
This file contains hidden or 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
# Greenwich Village and Soho Top 5 Pizza Restaurants | |
library(tidyverse) | |
library(leaflet) | |
pizza_barstool <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-10-01/pizza_barstool.csv") | |
zip_list <- c(10012, 10013, 10014) | |
ready_to_plot <- pizza_barstool %>% | |
filter(zip %in% zip_list) %>% | |
mutate(name = paste(name, review_stats_dave_average_score, "out of 10")) | |
ready_to_plot <- ready_to_plot %>% | |
group_by(name) %>% | |
summarise(mean = mean(review_stats_dave_average_score)) %>% | |
top_n(5) %>% | |
full_join(ready_to_plot, by = "name") %>% | |
drop_na(mean) | |
leaflet(ready_to_plot) %>% | |
addTiles() %>% | |
addPopups(lng = ~longitude, lat = ~latitude, popup = ~name, | |
options = popupOptions(closeButton = FALSE)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment