Skip to content

Instantly share code, notes, and snippets.

@ajstewartlang
Last active October 1, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajstewartlang/0dc66c9e9abf1f5f12ba2a7e16b501ee to your computer and use it in GitHub Desktop.
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
# 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