Introduction

This Notebook documents the progress of constructing charts in the lead-up to and duration of the 2020 League of Legend Mid-Season Cup between the LCK and LPL. Because of the COVID-19 pandemic, the regular League of Legends MidSeason Invitational (MSI) has been cancelled. This new tournament between the League of Legends Pro League (LPL) and League Champions Korea (LCK) has been created to hold some place of a Mid-Season tournament for players and fans.

Installing Packages

Going into the analysis, we’ll some packages. These packages are recommended by Tom’s Cookbook for better Viz (https://jthomasmock.github.io/nfl_plotting_cookbook/) , which was initially constructed for nflscrapR data. R Markdown doesn’t like running installs more than once, so just copy and paste each line after the # sign. Once you install these packages in your working directory R will be able to use them repeatedly so long as you use the library function.

#install.packages('tidyverse') # Data Cleaning, manipulation, summarization, plotting
#install.packages('gt') # beautiful tables
#install.packages('DT') # beautiful interactive tables
#install.packages('ggthemes') # custom pre-built themes
#install.packages('ggforce') # better annotations
#install.packages('ggridges') # many distributions at once
#install.packages('ggrepel') # better labels
#install.packages('ggbeeswarm') # beeswarm plot
#install.packages('extrafont') # for extra fonts

Now that we’ve installed the packages, we’re going to load them into our R session.

library(tidyverse) # Data Cleaning, manipulation, summarization, plotting
library(gt) # beautiful tables
library(DT) # beautiful interactive tables
library(ggthemes) # custom pre-built themes
library(ggforce) # better annotations
library(ggridges) # many distributions at once
library(ggrepel) # better labels
library(ggbeeswarm) # beeswarm plots
library(extrafont) # for extra fonts

Reading in the Playoff Data

For this analysis we’re going to be using the most recent playoff data for the teams competing.
## LPL
1. JD Gaming (LPL Spring 2020 Champions) 2. Top Esports 3. FunPlus Phoenix (Reigning 2019 World Champions) 4. Invictus Gaming (2018 World Champions)

LCK:

  1. T1 (LCK Spring 2020 Champions, 3x World Champions, 2x MSI Champions)
  2. Gen.G (2017 World Champions)
  3. DragonX
  4. DAMWON Gaming

To read in this data, we’re going to pull in the data from Oracle’s Elixir (https://oracleselixir.com/) , which has been separated to include the playoffs of the LPL, LCK, LCS, and LEC. The LCS and LEC data will be useful for further exploration and ‘what-if’ discussion.

 library(readxl)
LCK_playoff_data <- read_excel("2020 spring match data OraclesElixir 2020-05-11.xlsx", sheet = "LCK-Playoffs")
View(LCK_playoff_data)
  library(readxl)
LPL_playoff_data <- read_excel("2020 spring match data OraclesElixir 2020-05-11.xlsx", sheet = "LPL-Playoffs")
View(LPL_playoff_data)
library(readxl)
LCS_playoff_data <- read_excel("2020 spring match data OraclesElixir 2020-05-11.xlsx", sheet = "LCS-Playoffs")
View(LCS_playoff_data)
library(readxl)
LEC_playoff_data <- read_excel("2020 spring match data OraclesElixir 2020-05-11.xlsx", sheet = "LEC-Playoffs")
View(LEC_playoff_data)

Cleaning the Data

Now that we have the playoff data for each region, we’re going to narrow it down to each team competing, as well as the top four teams from the LCS and LEC.
The top four teams in the LEC and LCS for the Spring Split in 2020 were:
## LEC 1. G2 Esports (LEC 2020 Spring Champions, 2019 MSI Champions) 2. Fnatic (2011 World Champions) 3. Origen 4. MAD Lions
## LCS 1. Cloud9 2. Flyquest 3. Evil Geniuses 4. TeamSoloMid

Now that we have the teams specified, we’ll extract their matches from each playoff_data file

# Breaking down Data for LPL Teams #
JDG.data <- LPL_playoff_data %>% 
  filter(team == "JD Gaming")
TES.data <- LPL_playoff_data %>%
  filter(team == "Top Esports")
FPX.data <- LPL_playoff_data %>%
  filter(team == "FunPlus Phoenix")
IG.data <- LPL_playoff_data %>%
  filter(team == "Invictus Gaming")
#Breaking down data for LCK Teams#
T1.data <- LCK_playoff_data %>%
  filter(team == "T1")
Gen.G.data <- LCK_playoff_data %>%
  filter(team == "Gen.G")
DragonX.data <- LCK_playoff_data %>%
  filter(team == "DragonX")
DAMWON.data <- LCK_playoff_data %>%
  filter(team == "DAMWON Gaming")
# Breaking down for LCS teams #
Cloud9.data <- LCS_playoff_data %>%
  filter(team == "Cloud9")
Flyquest.data <- LCS_playoff_data %>%
  filter(team == "FlyQuest")
EG.data <- LCS_playoff_data %>%
  filter(team == "Evil Geniuses")
TSM.data <- LCS_playoff_data %>%
  filter(team == "Team SoloMid")
#Breaking down for LEC teams #
G2.data <- LEC_playoff_data %>%
  filter(team == "G2 Esports")
FNC.data <- LEC_playoff_data %>%
  filter(team == "Fnatic")
Origen.data <- LEC_playoff_data %>%
  filter(team == "Origen")
MAD.data <- LEC_playoff_data %>%
  filter(team == "MAD Lions")

Combining the Regions

Since we have four separate region files that have the data of their top four teams, we should combine them so we can compare the players and teams against one another for their roles. To do this we will use the rbind function.

MSC.data <- rbind(JDG.data, TES.data, FPX.data, IG.data, T1.data, Gen.G.data, DragonX.data, DAMWON.data) # for the actual midseason cup #
WSC.data <- rbind(G2.data, FNC.data, Origen.data, MAD.data, Cloud9.data, Flyquest.data, EG.data, TSM.data) # for the western teams i.e. 'western cup' #
top4.data <- rbind(MSC.data, WSC.data) # for the full data set of the top 4 teams #

Breaking into Positions

Now that we have the top 4 teams in their respective datasets, we can break them further into positions so we compare players based on their positions.

top.data <- top4.data %>%
  filter(position == "top")
jg.data <- top4.data %>%
  filter(position == "jng")
mid.data <- top4.data %>%
  filter(position == "mid")
bot.data <- top4.data %>%
  filter(position == "bot")
sup.data <- top4.data %>%
  filter(position == "sup")