TidyTuesday: Ramen Ratings
Jun 4, 2019
Christopher Yee
12 minute read

Data from #tidytuesday week of 2019-06-04 (source)

Load R packages

library(tidyverse)
library(plotly)

Download and parse data frame

ramen_raw <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-06-04/ramen_ratings.csv")

ramen <- ramen_raw %>% 
  group_by(brand, country) %>% 
  summarize(avg_rating = round(mean(stars),2),
            total_reviews = n()) 

Build plotly chart

plot_ly(data = ramen, 
        x = ~total_reviews, 
        y = ~avg_rating, 
        size = 15,
        color = ~country,
        colors = 'Paired', 
        text = ~paste("Brand: ", brand, 
                      "<br>Average Rating: ", avg_rating),
        showlegend = FALSE) %>% 
  layout(xaxis = list(title = "Total Reviews"),
         yaxis = list(title = "Average Ratings"))