Analytics Vidhya
Published in

Analytics Vidhya

Video Game Sales Dashboard Using R

Photo by Franck V. on Unsplash

Hello Everyone. In this post, I want to show my dashboard for the first time. I made this dashboard using R Studio with the help of several packages, including flexdashboard, dplyr, shiny, and plotly.

I am proud to have completed my first dashboard and I realize that this dashboard is not perfect.

What is a dashboard?.

In management information systems, a dashboard is a tool for reading, real-time user interface, displaying a graphic presentation of the current status (snapshot). In making dashboards, the main capability needed is data visualization.

I use the plotly package, because plotly is able to display good data visualization and present it interactively. Plotly is a technical computing company headquartered in Montreal, Quebec, that develops online data analytics and visualization tools. Plotly provides online graphing, analytics, and statistics tools for individuals and collaboration, as well as scientific graphing libraries for Python, R, MATLAB, Perl, Julia, Arduino, and REST.

Dashboard view that I made is shown in the picture below.

Page 1
Page 2
Page 3

It’s very simple right. For writing code, I use rmarkdown. Code can be seen below.

---
title: "Video Games Dashboard"
resource_files:
- Video_Game_Sales_as_of_Jan_2017.csv
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: rows
source_code: embed
theme: simplex
---
```{r setup, include=FALSE}
library(flexdashboard)
library(dplyr)
library(plotly)
library(shiny)
library(shinydashboard)
```
```{r global, include=FALSE}
data <- read.csv("../AMRI/R/dash-vidgame/dahsboard/Video_Game_Sales_as_of_Jan_2017.csv",
stringsAsFactors=FALSE)
```Data View
===
Column {.sidebar}
---
```{r}
selectInput("GENREVIEW", h3("Genre Filter :"),
choices = c(as.character(unique(data$Genre))),
selected = "Action")
selectInput("PLATFORMVIEW", h3("Platform Filter :"),
choices = c(as.character(unique(data$Platform))),
selected = "NES")
```
Introduction.
This dataset contains a list of video games with sales greater than 100,000 copies. It was generated by a scrape of vgchartz.com.Dashboard by Amri Rohman.
Sidoarjo, 1 September 2019.
Row
---
### Number of Video Games
```{r}
valueBox(dim(data)[1], icon = "fa-comments")
```
### Number of Features
```{r}
valueBox(dim(data)[2], icon = "fa-comments")
```
### Number of Genre
```{r}
valueBox(unique(data$Genre)%>%length(), icon = "fa-user")
```
### Number of Platform
```{r}
valueBox(unique(data$Platform)%>%length(), icon = "fa-user")
```
Row
---
### Data View
```{r}
renderTable({
data[,c(1:10)] %>%
filter(Genre==input$GENREVIEW) %>%
filter(Platform==input$PLATFORMVIEW) %>%
head(20)
})
```
Chart
===
Column {.sidebar}
---
```{r}
selectInput("GENRE", h3("Genre Filter :"),
choices = c(as.character(unique(data$Genre))),
selected = "Action")
```
Row
---
### Total Global Sales Line Plot by Genre
```{r}
renderPlotly({
data %>%
group_by(Year_of_Release, Genre) %>%
summarise(Total_Global_Sales = sum(Global_Sales)) %>%
filter(Genre==input$GENRE) %>%
data.frame() %>%
plot_ly(x = ~Year_of_Release,
y = ~Total_Global_Sales,
type = "scatter",
mode = "lines+markers")
})
```
### Count Video Games Genre
```{r}
data %>%
group_by(Genre) %>%
summarise(Count = n()) %>%
plot_ly(x = ~Genre,
y = ~Count,
type = "bar")
```
Scatter plot
===
Column {.sidebar}
---
```{r}
selectInput("XA", h3("Select X axis :"),
choices = c("NA_Sales", "EU_Sales", "JP_Sales", "Other_Sales", "Global_Sales"),
selected = "NA_Sales")
selectInput("YA", h3("Select Y axis :"),
choices = c("NA_Sales", "EU_Sales", "JP_Sales", "Other_Sales", "Global_Sales"),
selected = "NA_Sales")
```
Row
---
### Scatter plot
```{r}
renderPlotly({
data %>%
plot_ly(x = data[,c(input$XA)],
y = data[,c(input$YA)])
})
```
### Correlation Plot
```{r}
data[, c("NA_Sales", "EU_Sales", "JP_Sales", "Other_Sales", "Global_Sales")] %>%
cor(method = "pearson") %>%
corrplot::corrplot(addCoef.col = "white")
```

Thank You.

Amri Rohman.
Sidoarjo, East Java, ID.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahsan Amri Rohman

Ahsan Amri Rohman

Love sport science and bussines statistics, Indonesian.