This is an analysis of various matches in the “League of Legends” video game. This pits a red and blue team against each other. Using the data supplied in the following data set https://www.kaggle.com/bobbyscience/league-of-legends-diamond-ranked-games-10-min. The data set features 19 features per team (38 altogether). blueWins is the target value.
The win-rate is more or less evenly split between red and blue team wins
lol <- read.csv("league.csv")
library(ggplot2)
qplot(lol$blueWins,
geom="histogram",
binwidth=0.5)
I began looking at each feature and its effect on win rate.
options(scipen=10000)
#Total kills effect on wins
ggplot(lol, aes(x = blueKills, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Kills") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total deaths effects on wins
ggplot(lol, aes(x = blueDeaths, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Deaths") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Blue assists effects on wins.Perhaps a team with more assists is indicative
#of better teamwork, and more wins
ggplot(lol, aes(x = blueAssists, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Assists") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Imapact of killing monsters in 3 plots
ggplot(lol, aes(x = blueEliteMonsters, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Elite Monsters") +
ylab("Total Count") +
labs(fill = "Blue Wins")
ggplot(lol, aes(x = blueDragons, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Dragons") +
ylab("Total Count") +
labs(fill = "Blue Wins")
ggplot(lol, aes(x = blueHeralds, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Heralds") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Destroying towers is the objective of the game
#Does 1 tower falling imply a win, or is it consistently close?
ggplot(lol, aes(x = blueTowersDestroyed, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Towers Destroyed by Blue") +
ylab("Total Count") +
labs(fill = "Blue Wins")
ggplot(lol, aes(x = redTowersDestroyed, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Towers Destroyed by Red") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Gold Impact
#Split gold into bins
goldBin <- c(seq(14000,250000,2000))
lol$blueGoldBin <- cut(lol$blueTotalGold, breaks = goldBin)
lol$redGoldBin <- cut(lol$redTotalGold, breaks = goldBin)
ggplot(lol, aes(x = blueGoldBin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Total Gold") +
ylab("Total Count") +
labs(fill = "Blue Wins")
ggplot(lol, aes(x = redGoldBin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Red Total Gold") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Player avg level
ggplot(lol, aes(x = blueAvgLevel, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Average Level") +
ylab("Total Count") +
labs(fill = "Blue Wins")
## Warning: position_stack requires non-overlapping x intervals
#Total EXP, binning experience as too many values
options(scipen=5)
expBin = c(seq(14000,20000,2000))
lol$blueExpBin <- cut(lol$blueTotalExperience, breaks = expBin)
lol$redExpBin <- cut(lol$redTotalExperience, breaks = expBin)
ggplot(lol, aes(x = blueExpBin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Total EXP") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total minion killed
ggplot(lol, aes(x = blueTotalMinionsKilled, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Minion Kills") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total jungle minions killed
ggplot(lol, aes(x = blueTotalJungleMinionsKilled, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Jungle Kills") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Difference in gold between teams
difGoldBin = c(seq(-5000,5000,1000))
lol$difGoldBin <- cut(lol$blueGoldDiff, breaks = difGoldBin)
ggplot(lol, aes(x = difGoldBin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Gold Difference") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Difference in EXP between teams
difExpBin = c(seq(-5000,5000,1000))
lol$difExpBin <- cut(lol$blueExperienceDiff, breaks = difExpBin)
ggplot(lol, aes(x = difExpBin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue EXP Difference") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total CS per minute
ggplot(lol, aes(x = blueCSPerMin, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue CS Per Minute") +
ylab("Total Count") +
labs(fill = "Blue Wins")
## Warning: position_stack requires non-overlapping x intervals
#Total Gold per minute
gpm = c(seq(1000,2500,500))
lol$gpm <- cut(lol$blueGoldPerMin, breaks = gpm)
ggplot(lol, aes(x = gpm, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Gold Per Minute") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total wards places
ggplot(lol, aes(x = blueWardsPlaced, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Wards Placed") +
ylab("Total Count") +
labs(fill = "Blue Wins")
#Total wards destroyed
ggplot(lol, aes(x = blueWardsDestroyed, fill = factor(blueWins))) +
stat_count(width = 0.5) +
xlab("Blue Wards Destroyed") +
ylab("Total Count") +
labs(fill = "Blue Wins")