---
title: "Popular Content in MyAnimeList and Steam"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
theme: bootstrap
source_code: embed
---
```{r setup, include=FALSE}
# Importing libraries
library(flexdashboard)
library(flexdashboard)
library(tidyverse)
library(highcharter)
library(gt)
library(htmltools)
library(viridis)
# Importing data
df <- read_csv('Anime.csv', show_col_types = FALSE)
df <- df %>%
select(-c(ID, Synonyms, Japanese, Title)) %>%
distinct(English, .keep_all = TRUE) %>%
rename(Title = 'English') %>%
rename(`Type` = 'Type')
```
MyAnimeList.net
=======================================================================
Column {.tabset .tabset-fade data-width=650}
-----------------------------------------------------------------------
### Best Rated Anime Studios
```{r}
df7 <- df %>%
group_by(Studios) %>%
summarise(Score = mean(Score)) %>%
arrange(desc(Score)) %>%
head(15)
df7 %>%
hchart('lollipop', hcaes(x = Studios, y = Score)) %>%
hc_yAxis(min = '8',
max = '9',
title = list(text = '')) %>%
hc_xAxis(title = list(text = '')) %>%
hc_add_theme(hc_theme_google()) %>%
hc_tooltip(pointFormat = '<b>Average Score </b> {point.y} <br>') %>%
hc_subtitle(text = 'Average score of anime given from users in MyAnimeList.net',
style = list(fontSize = '16px'))
```
### Most Popular Anime
```{r}
df8 <- df %>%
arrange(desc(Score)) %>%
head(15)
df8 %>%
hchart('bar', hcaes(x = Title, y = Score)) %>%
hc_yAxis(min = '8.9',
max = '9.15',
title = list(text = '')) %>%
hc_xAxis(title = list(text = '')) %>%
hc_add_theme(hc_theme_google()) %>%
hc_tooltip(pointFormat = 'Rank </b> {point.y} <br>') %>%
hc_subtitle(text = 'Average score of the anime given from users in MyAnimeList.net',
style = list(fontSize = '16px')) %>%
hc_legend(
align = "left",
verticalAlign = "top",
layout = "vertical",
x = 0,
y = 100,
enabled = TRUE
)
```
Column {data-width=350}
-----------------------------------------------------------------------
### Most Common Type of Anime Format
```{r}
# Colors
custom_colors <- viridis::mako(n=6)
# make data
df9 <- df %>%
filter(!Type == 'Unknown') %>%
group_by(Type) %>%
summarise(count = n())
# Most common genre
df9 %>%
hchart('pie', hcaes(x=Type, y=count, color = custom_colors)) %>%
hc_add_theme(hc_theme_google()) %>%
hc_tooltip(pointFormat = '<b> Proportion: </b> {point.percentage:,.2f}%')
```
### Anime With Highest Episode Count (Finished Airing)
```{r}
# This is going to be the datatable for highest episode count
df1 <- df %>%
arrange(desc(Episodes)) %>%
select(Title, Episodes, Source) %>%
head(50)
# HTML table
div(style = 'height:600px; overflow-y:scroll', gt(df1) %>%
opt_table_font(font = list(google_font('Chivo'), default_fonts())) %>%
tab_style(location = cells_column_labels(columns = everything()),
style = list(cell_borders(sides = 'bottom',
weight = px(2)),
cell_text(weight = 'bold'))) %>%
tab_options(table.font.size = px(12L),
table.border.top.style = 'none',
column_labels.border.bottom.width = 2,
table_body.border.top.style = 'none',
data_row.padding = px(3))
)
```
Steam
=======================================================================
Column {.tabset .tabset-fade data-width=650}
-----------------------------------------------------------------------
### Best Rated Video Games
```{r}
df2 <- read_csv('games-features-edit.csv')
df2 <- df2 %>%
distinct(ResponseName, .keep_all = TRUE) %>%
rename(Title = 'ResponseName')
df2 %>%
arrange(desc(Metacritic)) %>%
head(15) %>%
hchart('lollipop', hcaes(x = Title, y = Metacritic)) %>%
hc_yAxis(min='92',
max = '98') %>%
hc_add_theme(hc_theme_google()) %>%
hc_tooltip(pointFormat = '<b>Metacritic Score </b> {point.y} <br>')
```
### Recommendation Count vs Metacritic
```{r}
df2 %>%
mutate(Genre = case_when(GenreIsMassivelyMultiplayer == TRUE ~ 'MMO', TRUE ~ 'Not MMO')) %>%
filter(PriceInitial >= 19.99) %>%
filter(!RecommendationCount == 0 & !Metacritic == 0) %>%
hchart('scatter', hcaes(x = log(RecommendationCount),
y = log(Metacritic),
group = Genre)) %>%
hc_tooltip(pointFormat = '<b>Recommendation Count: </b> {point.x} <br>
<b>Metacritic Score: </b> {point.y}') %>%
hc_yAxis(title = list(text = 'Metacritic (log)')) %>%
hc_xAxis(title = list(text = 'Recommendation Count (log)')) %>%
hc_add_theme(hc_theme_google())
```
Column {data-width=350}
-----------------------------------------------------------------------
### Proportion of Game Prices
```{r}
custom_colors = viridis::turbo(n = 8)
df3 <- df2 %>%
group_by(PriceInitial) %>%
summarise(count = n()) %>%
arrange(desc(count))
df3 %>%
filter(count >= 500) %>%
hchart('pie', hcaes(x=PriceInitial, y=count, color = custom_colors)) %>%
hc_add_theme(hc_theme_google()) %>%
hc_tooltip(pointFormat = '<b> Price: </b> ${point.x} <b> Proportion: </b> {point.percentage:,.2f}%') %>%
hc_subtitle(text = 'Volume of over 500',
style = list(fontSize = '16px'))
```
### Popularity Based Recommendation Count
```{r}
# This is going to be the datatable
df4 <- df2 %>%
arrange(desc(RecommendationCount)) %>%
select(Title, RecommendationCount, PriceInitial) %>%
head(50)
# HTML table
div(style = 'height:600px; overflow-y:scroll', gt(df4) %>%
opt_table_font(font = list(google_font('Chivo'), default_fonts())) %>%
tab_style(location = cells_column_labels(columns = everything()),
style = list(cell_borders(sides = 'bottom',
weight = px(2)),
cell_text(weight = 'bold'))) %>%
tab_options(table.font.size = px(12L),
table.border.top.style = 'none',
column_labels.border.bottom.width = 2,
table_body.border.top.style = 'none',
data_row.padding = px(3))
)
```