For this assignment, I will utilize an anime dataset pulled from MyAnimeList and publicly open in TidyTuesday project. The dataset will have trats like genre, type, source material, episodes, ratings, popularity, and even studios. # Approach For this assignment, I hope to use a MyAnmeList anime dataset that’s found in the TidyTuesday GitHub repository. The core question to be answered is whether traits like genre, format, etc. are correlated to higher viewer ratings. I will start with a smaller data frame that contains variables most suitable for the question, with anime score being the primary output variable. I will study the framework of the dataset and identify which columns are relevant for my investigation. I then hope to pinpoint those columns, providing succint labels and ensure categorical or numerical identifiers are showcased accordingly. It’s also vital I look for columns that ought to be transformed in order to make data simpler to comprehend. I should be ready for any data-related challenges. For instance, some show titles could have missing information when it coems to attributes while some shows might fall under several genres.I will need to outline these traits before determining how to present them through code.
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.2.0
## ✔ forcats 1.0.1 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.2 ✔ tibble 3.3.0
## ✔ lubridate 1.9.5 ✔ tidyr 1.3.2
## ✔ purrr 1.2.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
anime <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2019/2019-04-23/tidy_anime.csv")
## Rows: 77911 Columns: 28
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (17): name, title_english, title_japanese, title_synonyms, type, source...
## dbl (8): animeID, episodes, score, scored_by, rank, popularity, members, f...
## lgl (1): airing
## date (2): start_date, end_date
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
glimpse(anime)
## Rows: 77,911
## Columns: 28
## $ animeID <dbl> 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6…
## $ name <chr> "Cowboy Bebop", "Cowboy Bebop", "Cowboy Bebop", "Cowboy…
## $ title_english <chr> "Cowboy Bebop", "Cowboy Bebop", "Cowboy Bebop", "Cowboy…
## $ title_japanese <chr> "カウボーイビバップ", "カウボーイビバップ", "カウボーイビバップ", "カウボーイビバップ", "カウ…
## $ title_synonyms <chr> "[]", "[]", "[]", "[]", "[]", "[]", "[\"Cowboy Bebop: K…
## $ type <chr> "TV", "TV", "TV", "TV", "TV", "TV", "Movie", "Movie", "…
## $ source <chr> "Original", "Original", "Original", "Original", "Origin…
## $ producers <chr> "Bandai Visual", "Bandai Visual", "Bandai Visual", "Ban…
## $ genre <chr> "Action", "Adventure", "Comedy", "Drama", "Sci-Fi", "Sp…
## $ studio <chr> "Sunrise", "Sunrise", "Sunrise", "Sunrise", "Sunrise", …
## $ episodes <dbl> 26, 26, 26, 26, 26, 26, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2…
## $ status <chr> "Finished Airing", "Finished Airing", "Finished Airing"…
## $ airing <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,…
## $ start_date <date> 1998-04-03, 1998-04-03, 1998-04-03, 1998-04-03, 1998-0…
## $ end_date <date> 1999-04-02, 1999-04-02, 1999-04-02, 1999-04-02, 1999-0…
## $ duration <chr> "24 min per ep", "24 min per ep", "24 min per ep", "24 …
## $ rating <chr> "R - 17+ (violence & profanity)", "R - 17+ (violence & …
## $ score <dbl> 8.81, 8.81, 8.81, 8.81, 8.81, 8.81, 8.41, 8.41, 8.41, 8…
## $ scored_by <dbl> 405664, 405664, 405664, 405664, 405664, 405664, 120243,…
## $ rank <dbl> 26, 26, 26, 26, 26, 26, 164, 164, 164, 164, 164, 164, 1…
## $ popularity <dbl> 39, 39, 39, 39, 39, 39, 449, 449, 449, 449, 449, 449, 4…
## $ members <dbl> 795733, 795733, 795733, 795733, 795733, 795733, 197791,…
## $ favorites <dbl> 43460, 43460, 43460, 43460, 43460, 43460, 776, 776, 776…
## $ synopsis <chr> "In the year 2071, humanity has colonized several of th…
## $ background <chr> "When Cowboy Bebop first aired in spring of 1998 on TV …
## $ premiered <chr> "Spring 1998", "Spring 1998", "Spring 1998", "Spring 19…
## $ broadcast <chr> "Saturdays at 01:00 (JST)", "Saturdays at 01:00 (JST)",…
## $ related <chr> "{'Adaptation': [{'mal_id': 173, 'type': 'manga', 'name…
anime_selected <- anime %>%
select(name, type, genre, episodes, score, popularity) %>%
rename(
anime_title = name,
anime_type = type,
viewer_score = score,
popularity_rank = popularity,
)
anime_selected %>%
distinct(anime_title, .keep_all = TRUE)%>%
head(10)
## # A tibble: 10 × 6
## anime_title anime_type genre episodes viewer_score popularity_rank
## <chr> <chr> <chr> <dbl> <dbl> <dbl>
## 1 Cowboy Bebop TV Acti… 26 8.81 39
## 2 Cowboy Bebop: Tengoku… Movie Acti… 1 8.41 449
## 3 Trigun TV Acti… 26 8.3 146
## 4 Witch Hunter Robin TV Acti… 26 7.33 1171
## 5 Bouken Ou Beet TV Adve… 52 7.03 3704
## 6 Hachimitsu to Clover TV Come… 24 8.12 536
## 7 Hungry Heart: Wild St… TV Slic… 52 7.67 3124
## 8 Initial D Fourth Stage TV Acti… 24 8.23 1262
## 9 Monster TV Drama 74 8.69 156
## 10 Naruto TV Acti… 220 7.9 10
The dataset has been changed into a smaller set of variables linked to anime ratings and popularity. In the future, I would review how traits like genre, type, and episode count correlates with viewer scores.