library(ggplot2)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v tibble 3.1.6 v dplyr 1.0.7
## v tidyr 1.1.4 v stringr 1.4.0
## v readr 2.1.1 v forcats 0.5.1
## v purrr 0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(stringr)
filename <- "https://raw.githubusercontent.com/djunga/Project-2-Data-Tidying/main/ramen-ratings.csv"
responses <- read.csv(filename, header=TRUE, sep=",")
responses$Stars <- as.numeric(responses$Stars)
## Warning: NAs introduced by coercion
A bar graph showing the number of ramen variety ratings the ramen enthusiast made from each country.
ggplot(data = responses) +
geom_bar(mapping = aes(x = Country)) +
coord_flip()
my_selection <- responses %>%
select(Country, Brand, Variety, Style, Stars)
The ramen enthusiast’s highest rated ramen brands by country.
my_selection %>%
group_by(Country) %>%
arrange(Country) %>%
top_n(1, Stars)
## # A tibble: 407 x 5
## # Groups: Country [38]
## Country Brand Variety Style Stars
## <chr> <chr> <chr> <chr> <dbl>
## 1 Australia Maggi Fusian Special Edition Ow... Ow... Sp~ Pack 5
## 2 Bangladesh Pran Mr. Noodles Curry Flavor Instant Nood~ Pack 4
## 3 Bangladesh Pran Mr. Noodles Instant Noodles Beef Flav~ Pack 4
## 4 Bangladesh Mama Oriental Style Instant Noodles Tandoo~ Pack 4
## 5 Bangladesh Mama Oriental Style Instant Noodles Hot & ~ Pack 4
## 6 Brazil Nissin Cup Noodles Sabor Franhp Com Requeijao Cup 5
## 7 Cambodia Mama Instant Noodles chicken Green Curry F~ Pack 5
## 8 Cambodia Mama Instant Noodles Creamy Shrimp Tom Yum~ Pack 5
## 9 Canada Sapporo Ichiban Chow Mein Japanese Style Noodles Yaki~ Pack 5
## 10 Canada Plats Du Chef Cuisine Adventures Chicken Pho Soup Bowl 5
## # ... with 397 more rows