League of Legend

Since we have already established the correspondence between the most advantageous position in which the conversion rate is more remarkable between gold and damage on project 1, my data visualization intends to determine the influence of neutral objectives to victory per game. Furthermore, what is the relationship between getting the neutral objectives and game length?

Set the environment

# set the environment 
Packages <- c("dplyr", "tidyverse","treemap","RColorBrewer","highcharter","readr","plotly")

lapply(Packages, library, character.only = TRUE)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5     ✓ purrr   0.3.4
## ✓ tibble  3.1.2     ✓ stringr 1.4.0
## ✓ tidyr   1.1.3     ✓ forcats 0.5.1
## ✓ readr   1.4.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
## [[1]]
## [1] "dplyr"     "stats"     "graphics"  "grDevices" "utils"     "datasets" 
## [7] "methods"   "base"     
## 
## [[2]]
##  [1] "forcats"   "stringr"   "purrr"     "readr"     "tidyr"     "tibble"   
##  [7] "ggplot2"   "tidyverse" "dplyr"     "stats"     "graphics"  "grDevices"
## [13] "utils"     "datasets"  "methods"   "base"     
## 
## [[3]]
##  [1] "treemap"   "forcats"   "stringr"   "purrr"     "readr"     "tidyr"    
##  [7] "tibble"    "ggplot2"   "tidyverse" "dplyr"     "stats"     "graphics" 
## [13] "grDevices" "utils"     "datasets"  "methods"   "base"     
## 
## [[4]]
##  [1] "RColorBrewer" "treemap"      "forcats"      "stringr"      "purrr"       
##  [6] "readr"        "tidyr"        "tibble"       "ggplot2"      "tidyverse"   
## [11] "dplyr"        "stats"        "graphics"     "grDevices"    "utils"       
## [16] "datasets"     "methods"      "base"        
## 
## [[5]]
##  [1] "highcharter"  "RColorBrewer" "treemap"      "forcats"      "stringr"     
##  [6] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"     
## [11] "tidyverse"    "dplyr"        "stats"        "graphics"     "grDevices"   
## [16] "utils"        "datasets"     "methods"      "base"        
## 
## [[6]]
##  [1] "highcharter"  "RColorBrewer" "treemap"      "forcats"      "stringr"     
##  [6] "purrr"        "readr"        "tidyr"        "tibble"       "ggplot2"     
## [11] "tidyverse"    "dplyr"        "stats"        "graphics"     "grDevices"   
## [16] "utils"        "datasets"     "methods"      "base"        
## 
## [[7]]
##  [1] "plotly"       "highcharter"  "RColorBrewer" "treemap"      "forcats"     
##  [6] "stringr"      "purrr"        "readr"        "tidyr"        "tibble"      
## [11] "ggplot2"      "tidyverse"    "dplyr"        "stats"        "graphics"    
## [16] "grDevices"    "utils"        "datasets"     "methods"      "base"

Load the first dataset

# Load the first dataset
setwd("~/Documents/DATA 110/data")
lol = read.csv("LeagueofLegends.csv",stringsAsFactors = FALSE)

check the parameter of the dataset and switch the data type from original to the appropreate format.

# check the parameter of the dataset and switch the data type from original to the appropreate format. 
str(lol)
## 'data.frame':    7620 obs. of  57 variables:
##  $ League          : chr  "NALCS" "NALCS" "NALCS" "NALCS" ...
##  $ Year            : int  2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
##  $ Season          : chr  "Spring" "Spring" "Spring" "Spring" ...
##  $ Type            : chr  "Season" "Season" "Season" "Season" ...
##  $ blueTeamTag     : chr  "TSM" "CST" "WFX" "TIP" ...
##  $ bResult         : int  1 0 1 0 1 0 1 1 0 1 ...
##  $ rResult         : int  0 1 0 1 0 1 0 0 1 0 ...
##  $ redTeamTag      : chr  "C9" "DIG" "GV" "TL" ...
##  $ gamelength      : int  40 38 40 41 35 24 39 43 41 32 ...
##  $ golddiff        : chr  "[0, 0, -14, -65, -268, -431, -488, -789, -494, -625, -1044, -313, -760, -697, -790, -611, 240, 845, 797, 1422, "| __truncated__ "[0, 0, -26, -18, 147, 237, -152, 18, 88, -242, 102, 117, 802, 1420, 1394, 1301, 1489, 1563, 1368, 1105, 205, 19"| __truncated__ "[0, 0, 10, -60, 34, 37, 589, 1064, 1258, 913, 1233, 1597, 1575, 3046, 2922, 3074, 3626, 3466, 5634, 5293, 4597,"| __truncated__ "[0, 0, -15, 25, 228, -6, -243, 175, -346, 16, -258, -57, -190, -111, -335, -8, 324, 428, -124, 768, 2712, 1813,"| __truncated__ ...
##  $ goldblue        : chr  "[2415, 2415, 2711, 3887, 5068, 6171, 7412, 8661, 10154, 11361, 12677, 14558, 15548, 16980, 18324, 19952, 22874,"| __truncated__ "[2415, 2415, 2705, 4108, 5511, 6797, 7637, 8953, 10183, 11419, 12956, 14294, 16027, 18288, 19698, 21528, 23855,"| __truncated__ "[2415, 2415, 2726, 3794, 4933, 6236, 8109, 9656, 11073, 12374, 13953, 15596, 16971, 20152, 21237, 22738, 24964,"| __truncated__ "[2415, 2415, 2705, 3847, 5398, 6473, 7720, 9308, 10547, 12033, 13449, 14936, 16150, 17883, 19332, 20408, 22017,"| __truncated__ ...
##  $ bKills          : chr  "[[10.82, 'C9 Hai', 'TSM Bjergsen', [], 9229, 8469], [16.286, 'C9 LemonNation', 'TSM WildTurtle', ['TSM Santorin"| __truncated__ "[[11.104, 'DIG Shiphtur', 'CST Jesiz', ['CST Impaler'], 9294, 8716], [12.332, 'DIG Crumbzz', 'CST Cris', ['CST "| __truncated__ "[[5.255, 'GV Keane', 'WFX Pobelter', ['WFX ShorterACE', 'WFX Gleeb'], 8568, 8250], [6.351, 'GV Cop', 'WFX Short"| __truncated__ "[[8.274, 'TL Quas', 'TIP Rhux', ['TIP Apollo'], 3491, 13787], [12.002, 'TL Fenix', 'TIP XiaoWeiXiao', ['TIP Rus"| __truncated__ ...
##  $ bTowers         : chr  "[[27.542, 'MID_LANE', 'BASE_TURRET'], [39.269, 'MID_LANE', 'NEXUS_TURRET'], [33.583, 'BOT_LANE', 'INNER_TURRET'"| __truncated__ "[[23.239, 'BOT_LANE', 'OUTER_TURRET'], [33.018, 'BOT_LANE', 'INNER_TURRET'], [28.989, 'BOT_LANE', 'FOUNTAIN_TUR"| __truncated__ "[[15.045, 'BOT_LANE', 'OUTER_TURRET'], [39.566, 'MID_LANE', 'NEXUS_TURRET'], [33.135, 'MID_LANE', 'BASE_TURRET'"| __truncated__ "[[19.941, 'BOT_LANE', 'OUTER_TURRET'], [38.77, 'TOP_LANE', 'INNER_TURRET'], [22.879, 'TOP_LANE', 'OUTER_TURRET'"| __truncated__ ...
##  $ bInhibs         : chr  "[[36.686, 'MID_LANE'], [29.274, 'MID_LANE']]" "[]" "[[37.511, 'TOP_LANE'], [37.38, 'BOT_LANE'], [39.322, 'MID_LANE'], [33.289, 'MID_LANE']]" "[]" ...
##  $ bDragons        : chr  "[[37.267, None]]" "[[32.545, None], [26.177, None], [19.119, None]]" "[[24.577, None], [37.867, None], [30.87, None], [18.255, None]]" "[]" ...
##  $ bBarons         : chr  "[]" "[[29.255]]" "[[35.144]]" "[[37.513]]" ...
##  $ bHeralds        : chr  "[]" "[]" "[]" "[]" ...
##  $ goldred         : chr  "[2415, 2415, 2725, 3952, 5336, 6602, 7900, 9450, 10648, 11986, 13721, 14871, 16308, 17677, 19114, 20563, 22634,"| __truncated__ "[2415, 2415, 2731, 4126, 5364, 6560, 7789, 8935, 10095, 11661, 12854, 14177, 15225, 16868, 18304, 20227, 22366,"| __truncated__ "[2415, 2415, 2716, 3854, 4899, 6199, 7520, 8592, 9815, 11461, 12720, 13999, 15396, 17106, 18315, 19664, 21338, "| __truncated__ "[2415, 2415, 2720, 3822, 5170, 6479, 7963, 9133, 10893, 12017, 13707, 14993, 16340, 17994, 19667, 20416, 21693,"| __truncated__ ...
##  $ rKills          : chr  "[[16.529, 'TSM Lustboy', 'C9 Balls', ['C9 Meteos', 'C9 Hai', 'C9 Sneaky'], 10782, 5030], [16.791, 'TSM Dyrus', "| __truncated__ "[[12.387, 'CST Jesiz', 'DIG Gamsu', ['DIG Shiphtur'], 9469, 3606], [12.689, 'CST Sheep', 'DIG Shiphtur', ['DIG "| __truncated__ "[[8.449, 'WFX Altec', 'GV Cop', ['GV BunnyFuFuu'], 10879, 1743], [12.91, 'WFX Altec', 'GV Saintvicious', ['GV H"| __truncated__ "[[7.768, 'TIP Rush', 'TL IWDominate', ['TL Fenix'], 7253, 7713], [9.681, 'TIP Adrian', 'TL IWDominate', ['TL KE"| __truncated__ ...
##  $ rTowers         : chr  "[[39.23, 'TOP_LANE', 'INNER_TURRET'], [20.681, 'MID_LANE', 'OUTER_TURRET'], [15.288, 'TOP_LANE', 'OUTER_TURRET'"| __truncated__ "[[19.257, 'MID_LANE', 'OUTER_TURRET'], [15.206, 'BOT_LANE', 'OUTER_TURRET'], [36.936, 'MID_LANE', 'NEXUS_TURRET"| __truncated__ "[[24.62, 'MID_LANE', 'OUTER_TURRET'], [30.493, 'TOP_LANE', 'OUTER_TURRET']]" "[[36.384, 'MID_LANE', 'NEXUS_TURRET'], [31.665, 'MID_LANE', 'BASE_TURRET'], [27.034, 'MID_LANE', 'INNER_TURRET'"| __truncated__ ...
##  $ rInhibs         : chr  "[]" "[[36.813, 'MID_LANE']]" "[]" "[[35.867, 'MID_LANE']]" ...
##  $ rDragons        : chr  "[[17.14, None], [30.934, None], [24.641, None]]" "[[12.264, None]]" "[]" "[[26.274, None], [10.153, None], [18.515, None], [32.796, None]]" ...
##  $ rBarons         : chr  "[[29.954]]" "[]" "[]" "[]" ...
##  $ rHeralds        : chr  "[]" "[]" "[]" "[]" ...
##  $ blueTop         : chr  "Dyrus" "Cris" "Flaresz" "Rhux" ...
##  $ blueTopChamp    : chr  "Irelia" "Gnar" "Renekton" "Irelia" ...
##  $ goldblueTop     : chr  "[475, 475, 532, 687, 893, 1058, 1172, 1471, 1832, 2051, 2249, 2654, 2971, 3284, 3630, 3935, 4504, 5059, 5342, 6"| __truncated__ "[475, 475, 532, 791, 1127, 1509, 1674, 1875, 2103, 2406, 2724, 3044, 3308, 4322, 4594, 4937, 5563, 5833, 6063, "| __truncated__ "[475, 475, 533, 673, 828, 1075, 1428, 1775, 2127, 2419, 2722, 2984, 3301, 4001, 4187, 4300, 4803, 5169, 6005, 6"| __truncated__ "[475, 475, 532, 646, 992, 1253, 1408, 1752, 2176, 2662, 2931, 3314, 3631, 3993, 4296, 4427, 4822, 4988, 5132, 5"| __truncated__ ...
##  $ blueJungle      : chr  "Santorin" "Impaler" "ShorterACE" "Rush" ...
##  $ blueJungleChamp : chr  "RekSai" "Rengar" "Rengar" "JarvanIV" ...
##  $ goldblueJungle  : chr  "[475, 475, 532, 870, 1049, 1276, 1596, 1815, 2241, 2486, 2707, 3016, 3259, 3476, 3632, 4074, 4668, 5066, 5406, "| __truncated__ "[475, 475, 532, 895, 1176, 1334, 1447, 1859, 2128, 2350, 2693, 2909, 3368, 3682, 3929, 4262, 4699, 4977, 5090, "| __truncated__ "[475, 475, 543, 836, 1041, 1261, 1568, 2002, 2322, 2552, 2849, 3188, 3428, 3799, 4026, 4234, 4570, 4684, 5151, "| __truncated__ "[475, 475, 532, 909, 1272, 1387, 1705, 2009, 2123, 2390, 2657, 2895, 3055, 3320, 3627, 3873, 4126, 4365, 4479, "| __truncated__ ...
##  $ blueMiddle      : chr  "Bjergsen" "Jesiz" "Pobelter" "XiaoWeiXiao" ...
##  $ blueMiddleChamp : chr  "Ahri" "Ahri" "Fizz" "Leblanc" ...
##  $ goldblueMiddle  : chr  "[475, 475, 532, 807, 1102, 1307, 1651, 1950, 2218, 2663, 3057, 3698, 3844, 4298, 4608, 5045, 5721, 6200, 6834, "| __truncated__ "[475, 475, 532, 816, 1102, 1413, 1624, 1937, 2227, 2547, 2923, 3310, 4011, 4184, 4549, 4888, 5463, 5730, 5972, "| __truncated__ "[475, 475, 533, 756, 1065, 1368, 2056, 2237, 2574, 2865, 3251, 3505, 3780, 4655, 4861, 5363, 5859, 6228, 6662, "| __truncated__ "[475, 475, 532, 801, 1066, 1409, 1660, 2077, 2341, 2533, 2905, 3241, 3467, 4059, 4378, 4689, 5001, 5288, 5432, "| __truncated__ ...
##  $ blueADC         : chr  "WildTurtle" "Mash" "Altec" "Apollo" ...
##  $ blueADCChamp    : chr  "Jinx" "Caitlyn" "Sivir" "Sivir" ...
##  $ goldblueADC     : chr  "[475, 475, 532, 797, 1127, 1453, 1766, 2044, 2343, 2495, 2851, 3229, 3363, 3667, 4051, 4312, 4879, 5512, 5906, "| __truncated__ "[475, 475, 532, 856, 1182, 1468, 1653, 1890, 2175, 2415, 2744, 3033, 3168, 3544, 3869, 4362, 4778, 5139, 5500, "| __truncated__ "[475, 475, 533, 811, 1130, 1524, 1786, 2168, 2411, 2723, 3157, 3676, 4059, 4588, 4899, 5330, 5896, 6357, 7355, "| __truncated__ "[475, 475, 532, 791, 1202, 1383, 1752, 2121, 2435, 2756, 3133, 3495, 3854, 4217, 4555, 4791, 5317, 5603, 5852, "| __truncated__ ...
##  $ blueSupport     : chr  "Lustboy" "Sheep" "Gleeb" "Adrian" ...
##  $ blueSupportChamp: chr  "Janna" "Leona" "Annie" "Thresh" ...
##  $ goldblueSupport : chr  "[515, 515, 583, 726, 897, 1077, 1227, 1381, 1520, 1666, 1813, 1961, 2111, 2255, 2403, 2586, 3102, 3437, 3727, 4"| __truncated__ "[515, 515, 577, 750, 924, 1073, 1239, 1392, 1550, 1701, 1872, 1998, 2172, 2556, 2757, 3079, 3352, 3546, 3698, 3"| __truncated__ "[515, 515, 584, 718, 869, 1008, 1271, 1474, 1639, 1815, 1974, 2243, 2403, 3109, 3264, 3511, 3836, 4016, 4936, 5"| __truncated__ "[515, 515, 577, 700, 866, 1041, 1195, 1349, 1472, 1692, 1823, 1991, 2143, 2294, 2476, 2628, 2751, 2880, 3053, 3"| __truncated__ ...
##  $ blueBans        : chr  "['Rumble', 'Kassadin', 'Lissandra']" "['Kassadin', 'Sivir', 'Lissandra']" "['JarvanIV', 'Lissandra', 'Kassadin']" "['Annie', 'Lissandra', 'Kassadin']" ...
##  $ redTop          : chr  "Balls" "Gamsu" "Hauntzer" "Quas" ...
##  $ redTopChamp     : chr  "Gnar" "Irelia" "Sion" "Gnar" ...
##  $ goldredTop      : chr  "[475, 475, 532, 728, 958, 1284, 1526, 1912, 2165, 2587, 3011, 3273, 3706, 4068, 4377, 4725, 5275, 5739, 6162, 6"| __truncated__ "[475, 475, 532, 811, 1042, 1237, 1625, 1852, 2043, 2346, 2679, 2909, 3168, 3657, 3770, 4125, 4618, 4777, 5179, "| __truncated__ "[475, 475, 533, 706, 861, 1123, 1491, 1698, 1885, 2113, 2464, 2753, 3033, 3401, 3532, 3945, 4371, 4739, 4909, 5"| __truncated__ "[475, 475, 532, 732, 922, 1309, 1678, 1992, 2277, 2390, 2663, 2909, 3262, 3521, 3785, 3917, 4075, 4239, 4670, 4"| __truncated__ ...
##  $ redJungle       : chr  "Meteos" "Crumbzz" "Saintvicious" "IWDominate" ...
##  $ redJungleChamp  : chr  "Elise" "JarvanIV" "LeeSin" "Nunu" ...
##  $ goldredJungle   : chr  "[475, 475, 532, 898, 1192, 1429, 1819, 2107, 2419, 2555, 3031, 3279, 3592, 3931, 4099, 4535, 4987, 5456, 5875, "| __truncated__ "[475, 475, 532, 909, 1105, 1423, 1536, 1732, 1960, 2285, 2520, 2741, 2885, 3054, 3415, 3638, 3921, 4186, 4299, "| __truncated__ "[475, 475, 533, 845, 1089, 1443, 1694, 1914, 2207, 2454, 2677, 2977, 3317, 3857, 3971, 4134, 4449, 4871, 4985, "| __truncated__ "[475, 475, 541, 832, 1171, 1385, 1770, 2087, 2715, 2937, 3395, 3658, 3943, 4487, 4646, 4799, 5055, 5265, 5452, "| __truncated__ ...
##  $ redMiddle       : chr  "Hai" "Shiphtur" "Keane" "Fenix" ...
##  $ redMiddleChamp  : chr  "Fizz" "Azir" "Azir" "Lulu" ...
##  $ goldredMiddle   : chr  "[475, 475, 552, 842, 1178, 1378, 1635, 1949, 2285, 2561, 2896, 3127, 3277, 3623, 4043, 4250, 4702, 5061, 5335, "| __truncated__ "[475, 475, 552, 786, 1097, 1389, 1660, 1955, 2214, 2601, 2897, 3255, 3369, 3992, 4418, 4728, 5199, 5529, 5840, "| __truncated__ "[475, 475, 533, 801, 1006, 1233, 1385, 1720, 1948, 2254, 2553, 2720, 2967, 3199, 3578, 3994, 4339, 4579, 5163, "| __truncated__ "[475, 475, 532, 771, 1046, 1288, 1534, 1776, 2188, 2468, 2831, 3125, 3389, 3684, 4420, 4602, 4886, 5182, 5457, "| __truncated__ ...
##  $ redADC          : chr  "Sneaky" "CoreJJ" "Cop" "KEITH" ...
##  $ redADCChamp     : chr  "Sivir" "Corki" "Corki" "KogMaw" ...
##  $ goldredADC      : chr  "[475, 475, 532, 762, 1097, 1469, 1726, 2112, 2287, 2621, 2976, 3222, 3634, 3787, 4149, 4459, 4829, 5185, 5810, "| __truncated__ "[475, 475, 532, 868, 1220, 1445, 1732, 1979, 2299, 2670, 2862, 3213, 3552, 3666, 4061, 4734, 5326, 5729, 6032, "| __truncated__ "[475, 475, 533, 781, 1085, 1398, 1782, 1957, 2330, 2854, 3099, 3477, 3816, 4165, 4582, 4695, 5116, 5601, 6057, "| __truncated__ "[475, 475, 532, 766, 1161, 1438, 1776, 1936, 2199, 2568, 2927, 3237, 3542, 3957, 4243, 4358, 4626, 4813, 5155, "| __truncated__ ...
##  $ redSupport      : chr  "LemonNation" "KiWiKiD" "BunnyFuFuu" "Xpecial" ...
##  $ redSupportChamp : chr  "Thresh" "Annie" "Janna" "Janna" ...
##  $ goldredSupport  : chr  "[515, 515, 577, 722, 911, 1042, 1194, 1370, 1492, 1662, 1807, 1970, 2099, 2268, 2446, 2594, 2841, 2988, 3236, 3"| __truncated__ "[515, 515, 583, 752, 900, 1066, 1236, 1417, 1579, 1759, 1896, 2059, 2251, 2499, 2640, 3002, 3302, 3441, 3605, 3"| __truncated__ "[515, 515, 584, 721, 858, 1002, 1168, 1303, 1445, 1786, 1927, 2072, 2263, 2484, 2652, 2896, 3063, 3198, 3361, 3"| __truncated__ "[515, 515, 583, 721, 870, 1059, 1205, 1342, 1514, 1654, 1891, 2064, 2204, 2345, 2573, 2740, 3051, 3197, 3338, 3"| __truncated__ ...
##  $ redBans         : chr  "['Tristana', 'Leblanc', 'Nidalee']" "['RekSai', 'Janna', 'Leblanc']" "['Leblanc', 'Zed', 'RekSai']" "['RekSai', 'Rumble', 'LeeSin']" ...
##  $ Address         : chr  "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30030?gameHash=fbb300951ad8327c" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30054?gameHash=055b17da8456fdc8" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30067?gameHash=8e8a9b58df366e2d" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30091?gameHash=0ed1cd0e0e57329c" ...

#clean the dataset to avoid unexpected problems

#clean the dataset
names(lol) <- tolower(names(lol))
names(lol) <- gsub(" ","",names(lol))
str(lol)
## 'data.frame':    7620 obs. of  57 variables:
##  $ league          : chr  "NALCS" "NALCS" "NALCS" "NALCS" ...
##  $ year            : int  2015 2015 2015 2015 2015 2015 2015 2015 2015 2015 ...
##  $ season          : chr  "Spring" "Spring" "Spring" "Spring" ...
##  $ type            : chr  "Season" "Season" "Season" "Season" ...
##  $ blueteamtag     : chr  "TSM" "CST" "WFX" "TIP" ...
##  $ bresult         : int  1 0 1 0 1 0 1 1 0 1 ...
##  $ rresult         : int  0 1 0 1 0 1 0 0 1 0 ...
##  $ redteamtag      : chr  "C9" "DIG" "GV" "TL" ...
##  $ gamelength      : int  40 38 40 41 35 24 39 43 41 32 ...
##  $ golddiff        : chr  "[0, 0, -14, -65, -268, -431, -488, -789, -494, -625, -1044, -313, -760, -697, -790, -611, 240, 845, 797, 1422, "| __truncated__ "[0, 0, -26, -18, 147, 237, -152, 18, 88, -242, 102, 117, 802, 1420, 1394, 1301, 1489, 1563, 1368, 1105, 205, 19"| __truncated__ "[0, 0, 10, -60, 34, 37, 589, 1064, 1258, 913, 1233, 1597, 1575, 3046, 2922, 3074, 3626, 3466, 5634, 5293, 4597,"| __truncated__ "[0, 0, -15, 25, 228, -6, -243, 175, -346, 16, -258, -57, -190, -111, -335, -8, 324, 428, -124, 768, 2712, 1813,"| __truncated__ ...
##  $ goldblue        : chr  "[2415, 2415, 2711, 3887, 5068, 6171, 7412, 8661, 10154, 11361, 12677, 14558, 15548, 16980, 18324, 19952, 22874,"| __truncated__ "[2415, 2415, 2705, 4108, 5511, 6797, 7637, 8953, 10183, 11419, 12956, 14294, 16027, 18288, 19698, 21528, 23855,"| __truncated__ "[2415, 2415, 2726, 3794, 4933, 6236, 8109, 9656, 11073, 12374, 13953, 15596, 16971, 20152, 21237, 22738, 24964,"| __truncated__ "[2415, 2415, 2705, 3847, 5398, 6473, 7720, 9308, 10547, 12033, 13449, 14936, 16150, 17883, 19332, 20408, 22017,"| __truncated__ ...
##  $ bkills          : chr  "[[10.82, 'C9 Hai', 'TSM Bjergsen', [], 9229, 8469], [16.286, 'C9 LemonNation', 'TSM WildTurtle', ['TSM Santorin"| __truncated__ "[[11.104, 'DIG Shiphtur', 'CST Jesiz', ['CST Impaler'], 9294, 8716], [12.332, 'DIG Crumbzz', 'CST Cris', ['CST "| __truncated__ "[[5.255, 'GV Keane', 'WFX Pobelter', ['WFX ShorterACE', 'WFX Gleeb'], 8568, 8250], [6.351, 'GV Cop', 'WFX Short"| __truncated__ "[[8.274, 'TL Quas', 'TIP Rhux', ['TIP Apollo'], 3491, 13787], [12.002, 'TL Fenix', 'TIP XiaoWeiXiao', ['TIP Rus"| __truncated__ ...
##  $ btowers         : chr  "[[27.542, 'MID_LANE', 'BASE_TURRET'], [39.269, 'MID_LANE', 'NEXUS_TURRET'], [33.583, 'BOT_LANE', 'INNER_TURRET'"| __truncated__ "[[23.239, 'BOT_LANE', 'OUTER_TURRET'], [33.018, 'BOT_LANE', 'INNER_TURRET'], [28.989, 'BOT_LANE', 'FOUNTAIN_TUR"| __truncated__ "[[15.045, 'BOT_LANE', 'OUTER_TURRET'], [39.566, 'MID_LANE', 'NEXUS_TURRET'], [33.135, 'MID_LANE', 'BASE_TURRET'"| __truncated__ "[[19.941, 'BOT_LANE', 'OUTER_TURRET'], [38.77, 'TOP_LANE', 'INNER_TURRET'], [22.879, 'TOP_LANE', 'OUTER_TURRET'"| __truncated__ ...
##  $ binhibs         : chr  "[[36.686, 'MID_LANE'], [29.274, 'MID_LANE']]" "[]" "[[37.511, 'TOP_LANE'], [37.38, 'BOT_LANE'], [39.322, 'MID_LANE'], [33.289, 'MID_LANE']]" "[]" ...
##  $ bdragons        : chr  "[[37.267, None]]" "[[32.545, None], [26.177, None], [19.119, None]]" "[[24.577, None], [37.867, None], [30.87, None], [18.255, None]]" "[]" ...
##  $ bbarons         : chr  "[]" "[[29.255]]" "[[35.144]]" "[[37.513]]" ...
##  $ bheralds        : chr  "[]" "[]" "[]" "[]" ...
##  $ goldred         : chr  "[2415, 2415, 2725, 3952, 5336, 6602, 7900, 9450, 10648, 11986, 13721, 14871, 16308, 17677, 19114, 20563, 22634,"| __truncated__ "[2415, 2415, 2731, 4126, 5364, 6560, 7789, 8935, 10095, 11661, 12854, 14177, 15225, 16868, 18304, 20227, 22366,"| __truncated__ "[2415, 2415, 2716, 3854, 4899, 6199, 7520, 8592, 9815, 11461, 12720, 13999, 15396, 17106, 18315, 19664, 21338, "| __truncated__ "[2415, 2415, 2720, 3822, 5170, 6479, 7963, 9133, 10893, 12017, 13707, 14993, 16340, 17994, 19667, 20416, 21693,"| __truncated__ ...
##  $ rkills          : chr  "[[16.529, 'TSM Lustboy', 'C9 Balls', ['C9 Meteos', 'C9 Hai', 'C9 Sneaky'], 10782, 5030], [16.791, 'TSM Dyrus', "| __truncated__ "[[12.387, 'CST Jesiz', 'DIG Gamsu', ['DIG Shiphtur'], 9469, 3606], [12.689, 'CST Sheep', 'DIG Shiphtur', ['DIG "| __truncated__ "[[8.449, 'WFX Altec', 'GV Cop', ['GV BunnyFuFuu'], 10879, 1743], [12.91, 'WFX Altec', 'GV Saintvicious', ['GV H"| __truncated__ "[[7.768, 'TIP Rush', 'TL IWDominate', ['TL Fenix'], 7253, 7713], [9.681, 'TIP Adrian', 'TL IWDominate', ['TL KE"| __truncated__ ...
##  $ rtowers         : chr  "[[39.23, 'TOP_LANE', 'INNER_TURRET'], [20.681, 'MID_LANE', 'OUTER_TURRET'], [15.288, 'TOP_LANE', 'OUTER_TURRET'"| __truncated__ "[[19.257, 'MID_LANE', 'OUTER_TURRET'], [15.206, 'BOT_LANE', 'OUTER_TURRET'], [36.936, 'MID_LANE', 'NEXUS_TURRET"| __truncated__ "[[24.62, 'MID_LANE', 'OUTER_TURRET'], [30.493, 'TOP_LANE', 'OUTER_TURRET']]" "[[36.384, 'MID_LANE', 'NEXUS_TURRET'], [31.665, 'MID_LANE', 'BASE_TURRET'], [27.034, 'MID_LANE', 'INNER_TURRET'"| __truncated__ ...
##  $ rinhibs         : chr  "[]" "[[36.813, 'MID_LANE']]" "[]" "[[35.867, 'MID_LANE']]" ...
##  $ rdragons        : chr  "[[17.14, None], [30.934, None], [24.641, None]]" "[[12.264, None]]" "[]" "[[26.274, None], [10.153, None], [18.515, None], [32.796, None]]" ...
##  $ rbarons         : chr  "[[29.954]]" "[]" "[]" "[]" ...
##  $ rheralds        : chr  "[]" "[]" "[]" "[]" ...
##  $ bluetop         : chr  "Dyrus" "Cris" "Flaresz" "Rhux" ...
##  $ bluetopchamp    : chr  "Irelia" "Gnar" "Renekton" "Irelia" ...
##  $ goldbluetop     : chr  "[475, 475, 532, 687, 893, 1058, 1172, 1471, 1832, 2051, 2249, 2654, 2971, 3284, 3630, 3935, 4504, 5059, 5342, 6"| __truncated__ "[475, 475, 532, 791, 1127, 1509, 1674, 1875, 2103, 2406, 2724, 3044, 3308, 4322, 4594, 4937, 5563, 5833, 6063, "| __truncated__ "[475, 475, 533, 673, 828, 1075, 1428, 1775, 2127, 2419, 2722, 2984, 3301, 4001, 4187, 4300, 4803, 5169, 6005, 6"| __truncated__ "[475, 475, 532, 646, 992, 1253, 1408, 1752, 2176, 2662, 2931, 3314, 3631, 3993, 4296, 4427, 4822, 4988, 5132, 5"| __truncated__ ...
##  $ bluejungle      : chr  "Santorin" "Impaler" "ShorterACE" "Rush" ...
##  $ bluejunglechamp : chr  "RekSai" "Rengar" "Rengar" "JarvanIV" ...
##  $ goldbluejungle  : chr  "[475, 475, 532, 870, 1049, 1276, 1596, 1815, 2241, 2486, 2707, 3016, 3259, 3476, 3632, 4074, 4668, 5066, 5406, "| __truncated__ "[475, 475, 532, 895, 1176, 1334, 1447, 1859, 2128, 2350, 2693, 2909, 3368, 3682, 3929, 4262, 4699, 4977, 5090, "| __truncated__ "[475, 475, 543, 836, 1041, 1261, 1568, 2002, 2322, 2552, 2849, 3188, 3428, 3799, 4026, 4234, 4570, 4684, 5151, "| __truncated__ "[475, 475, 532, 909, 1272, 1387, 1705, 2009, 2123, 2390, 2657, 2895, 3055, 3320, 3627, 3873, 4126, 4365, 4479, "| __truncated__ ...
##  $ bluemiddle      : chr  "Bjergsen" "Jesiz" "Pobelter" "XiaoWeiXiao" ...
##  $ bluemiddlechamp : chr  "Ahri" "Ahri" "Fizz" "Leblanc" ...
##  $ goldbluemiddle  : chr  "[475, 475, 532, 807, 1102, 1307, 1651, 1950, 2218, 2663, 3057, 3698, 3844, 4298, 4608, 5045, 5721, 6200, 6834, "| __truncated__ "[475, 475, 532, 816, 1102, 1413, 1624, 1937, 2227, 2547, 2923, 3310, 4011, 4184, 4549, 4888, 5463, 5730, 5972, "| __truncated__ "[475, 475, 533, 756, 1065, 1368, 2056, 2237, 2574, 2865, 3251, 3505, 3780, 4655, 4861, 5363, 5859, 6228, 6662, "| __truncated__ "[475, 475, 532, 801, 1066, 1409, 1660, 2077, 2341, 2533, 2905, 3241, 3467, 4059, 4378, 4689, 5001, 5288, 5432, "| __truncated__ ...
##  $ blueadc         : chr  "WildTurtle" "Mash" "Altec" "Apollo" ...
##  $ blueadcchamp    : chr  "Jinx" "Caitlyn" "Sivir" "Sivir" ...
##  $ goldblueadc     : chr  "[475, 475, 532, 797, 1127, 1453, 1766, 2044, 2343, 2495, 2851, 3229, 3363, 3667, 4051, 4312, 4879, 5512, 5906, "| __truncated__ "[475, 475, 532, 856, 1182, 1468, 1653, 1890, 2175, 2415, 2744, 3033, 3168, 3544, 3869, 4362, 4778, 5139, 5500, "| __truncated__ "[475, 475, 533, 811, 1130, 1524, 1786, 2168, 2411, 2723, 3157, 3676, 4059, 4588, 4899, 5330, 5896, 6357, 7355, "| __truncated__ "[475, 475, 532, 791, 1202, 1383, 1752, 2121, 2435, 2756, 3133, 3495, 3854, 4217, 4555, 4791, 5317, 5603, 5852, "| __truncated__ ...
##  $ bluesupport     : chr  "Lustboy" "Sheep" "Gleeb" "Adrian" ...
##  $ bluesupportchamp: chr  "Janna" "Leona" "Annie" "Thresh" ...
##  $ goldbluesupport : chr  "[515, 515, 583, 726, 897, 1077, 1227, 1381, 1520, 1666, 1813, 1961, 2111, 2255, 2403, 2586, 3102, 3437, 3727, 4"| __truncated__ "[515, 515, 577, 750, 924, 1073, 1239, 1392, 1550, 1701, 1872, 1998, 2172, 2556, 2757, 3079, 3352, 3546, 3698, 3"| __truncated__ "[515, 515, 584, 718, 869, 1008, 1271, 1474, 1639, 1815, 1974, 2243, 2403, 3109, 3264, 3511, 3836, 4016, 4936, 5"| __truncated__ "[515, 515, 577, 700, 866, 1041, 1195, 1349, 1472, 1692, 1823, 1991, 2143, 2294, 2476, 2628, 2751, 2880, 3053, 3"| __truncated__ ...
##  $ bluebans        : chr  "['Rumble', 'Kassadin', 'Lissandra']" "['Kassadin', 'Sivir', 'Lissandra']" "['JarvanIV', 'Lissandra', 'Kassadin']" "['Annie', 'Lissandra', 'Kassadin']" ...
##  $ redtop          : chr  "Balls" "Gamsu" "Hauntzer" "Quas" ...
##  $ redtopchamp     : chr  "Gnar" "Irelia" "Sion" "Gnar" ...
##  $ goldredtop      : chr  "[475, 475, 532, 728, 958, 1284, 1526, 1912, 2165, 2587, 3011, 3273, 3706, 4068, 4377, 4725, 5275, 5739, 6162, 6"| __truncated__ "[475, 475, 532, 811, 1042, 1237, 1625, 1852, 2043, 2346, 2679, 2909, 3168, 3657, 3770, 4125, 4618, 4777, 5179, "| __truncated__ "[475, 475, 533, 706, 861, 1123, 1491, 1698, 1885, 2113, 2464, 2753, 3033, 3401, 3532, 3945, 4371, 4739, 4909, 5"| __truncated__ "[475, 475, 532, 732, 922, 1309, 1678, 1992, 2277, 2390, 2663, 2909, 3262, 3521, 3785, 3917, 4075, 4239, 4670, 4"| __truncated__ ...
##  $ redjungle       : chr  "Meteos" "Crumbzz" "Saintvicious" "IWDominate" ...
##  $ redjunglechamp  : chr  "Elise" "JarvanIV" "LeeSin" "Nunu" ...
##  $ goldredjungle   : chr  "[475, 475, 532, 898, 1192, 1429, 1819, 2107, 2419, 2555, 3031, 3279, 3592, 3931, 4099, 4535, 4987, 5456, 5875, "| __truncated__ "[475, 475, 532, 909, 1105, 1423, 1536, 1732, 1960, 2285, 2520, 2741, 2885, 3054, 3415, 3638, 3921, 4186, 4299, "| __truncated__ "[475, 475, 533, 845, 1089, 1443, 1694, 1914, 2207, 2454, 2677, 2977, 3317, 3857, 3971, 4134, 4449, 4871, 4985, "| __truncated__ "[475, 475, 541, 832, 1171, 1385, 1770, 2087, 2715, 2937, 3395, 3658, 3943, 4487, 4646, 4799, 5055, 5265, 5452, "| __truncated__ ...
##  $ redmiddle       : chr  "Hai" "Shiphtur" "Keane" "Fenix" ...
##  $ redmiddlechamp  : chr  "Fizz" "Azir" "Azir" "Lulu" ...
##  $ goldredmiddle   : chr  "[475, 475, 552, 842, 1178, 1378, 1635, 1949, 2285, 2561, 2896, 3127, 3277, 3623, 4043, 4250, 4702, 5061, 5335, "| __truncated__ "[475, 475, 552, 786, 1097, 1389, 1660, 1955, 2214, 2601, 2897, 3255, 3369, 3992, 4418, 4728, 5199, 5529, 5840, "| __truncated__ "[475, 475, 533, 801, 1006, 1233, 1385, 1720, 1948, 2254, 2553, 2720, 2967, 3199, 3578, 3994, 4339, 4579, 5163, "| __truncated__ "[475, 475, 532, 771, 1046, 1288, 1534, 1776, 2188, 2468, 2831, 3125, 3389, 3684, 4420, 4602, 4886, 5182, 5457, "| __truncated__ ...
##  $ redadc          : chr  "Sneaky" "CoreJJ" "Cop" "KEITH" ...
##  $ redadcchamp     : chr  "Sivir" "Corki" "Corki" "KogMaw" ...
##  $ goldredadc      : chr  "[475, 475, 532, 762, 1097, 1469, 1726, 2112, 2287, 2621, 2976, 3222, 3634, 3787, 4149, 4459, 4829, 5185, 5810, "| __truncated__ "[475, 475, 532, 868, 1220, 1445, 1732, 1979, 2299, 2670, 2862, 3213, 3552, 3666, 4061, 4734, 5326, 5729, 6032, "| __truncated__ "[475, 475, 533, 781, 1085, 1398, 1782, 1957, 2330, 2854, 3099, 3477, 3816, 4165, 4582, 4695, 5116, 5601, 6057, "| __truncated__ "[475, 475, 532, 766, 1161, 1438, 1776, 1936, 2199, 2568, 2927, 3237, 3542, 3957, 4243, 4358, 4626, 4813, 5155, "| __truncated__ ...
##  $ redsupport      : chr  "LemonNation" "KiWiKiD" "BunnyFuFuu" "Xpecial" ...
##  $ redsupportchamp : chr  "Thresh" "Annie" "Janna" "Janna" ...
##  $ goldredsupport  : chr  "[515, 515, 577, 722, 911, 1042, 1194, 1370, 1492, 1662, 1807, 1970, 2099, 2268, 2446, 2594, 2841, 2988, 3236, 3"| __truncated__ "[515, 515, 583, 752, 900, 1066, 1236, 1417, 1579, 1759, 1896, 2059, 2251, 2499, 2640, 3002, 3302, 3441, 3605, 3"| __truncated__ "[515, 515, 584, 721, 858, 1002, 1168, 1303, 1445, 1786, 1927, 2072, 2263, 2484, 2652, 2896, 3063, 3198, 3361, 3"| __truncated__ "[515, 515, 583, 721, 870, 1059, 1205, 1342, 1514, 1654, 1891, 2064, 2204, 2345, 2573, 2740, 3051, 3197, 3338, 3"| __truncated__ ...
##  $ redbans         : chr  "['Tristana', 'Leblanc', 'Nidalee']" "['RekSai', 'Janna', 'Leblanc']" "['Leblanc', 'Zed', 'RekSai']" "['RekSai', 'Rumble', 'LeeSin']" ...
##  $ address         : chr  "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30030?gameHash=fbb300951ad8327c" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30054?gameHash=055b17da8456fdc8" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30067?gameHash=8e8a9b58df366e2d" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/30091?gameHash=0ed1cd0e0e57329c" ...

Extract the data and caculate the average gamelength

# extract the data
a = lol

# caculate the average game time
b= a %>%
  group_by(year,league)%>%
  summarise(avg_game = mean(gamelength),.groups = 'drop')%>%
  arrange(desc(league))

b$avg_game = round(b$avg_game,2)

Outlier Analysis

# identify which is the most famous years of lol (outlier analysis)
cols <- brewer.pal(4, "Set1")

highchart() %>%
  hc_add_series(data = b,
                   type = "line", hcaes(x = year,
                   y = avg_game, 
                   group = league)) %>%
  hc_colors(cols)%>%
   hc_xAxis(title = list(text="Year")) %>%
  hc_yAxis(title = list(text="Average game length (Per region)"))%>%
    hc_plotOptions(series = list(marker = list(symbol = "circle"))) %>%
  hc_legend(align = "right", 
            verticalAlign = "top")%>%
  hc_tooltip(shared = TRUE,
             borderColor = "black")

extract the data from the previous visualization

# extract the data from the previous visualization
real_lol = a%>%
  filter(year == 2017)

set the region and prepare for display the region in Tableau

# set the region and prepare for display the region in Tableau 
real_lol <- real_lol %>%
  mutate(region = case_when(
    league %in% c("CBLoL","CLS","LLN") ~ "Latin America & Caribbean",
    league %in% c("EULCS", "LCL") ~ "Europe & Central Asia",
    league %in% c("LCK", "LJL", "LMS","OPL") ~ "East Asia & Pacific",
    league %in% c("NALCS") ~ "North America",
    league %in% c("TCL") ~ "Middle East & North Africa",
    TRUE ~ "All"))

real_lol <- real_lol %>%
  mutate(region = factor(region, levels = rev(c("Latin America & Caribbean", "Europe & Central Asia", "East Asia & Pacific","North America", "Middle East & North Africa","All"))))


str(real_lol)
## 'data.frame':    3311 obs. of  58 variables:
##  $ league          : chr  "NALCS" "NALCS" "NALCS" "NALCS" ...
##  $ year            : int  2017 2017 2017 2017 2017 2017 2017 2017 2017 2017 ...
##  $ season          : chr  "Spring" "Spring" "Spring" "Spring" ...
##  $ type            : chr  "Season" "Season" "Season" "Season" ...
##  $ blueteamtag     : chr  "TSM" "C9" "FOX" "P1" ...
##  $ bresult         : int  0 1 0 1 0 1 0 1 1 1 ...
##  $ rresult         : int  1 0 1 0 1 0 1 0 0 0 ...
##  $ redteamtag      : chr  "C9" "TSM" "P1" "FOX" ...
##  $ gamelength      : int  41 37 39 25 35 44 31 37 49 44 ...
##  $ golddiff        : chr  "[0, 0, 20, 209, -31, 37, -38, -132, -370, -461, -228, -367, -1135, -2064, -2425, -2328, -2043, -2349, -1726, -1"| __truncated__ "[0, 0, -85, -187, -138, -15, -47, 620, 794, 624, 759, 807, 1669, 2164, 2373, 4074, 3397, 3553, 3776, 4915, 4124"| __truncated__ "[0, 0, 74, 133, 837, 1000, 1004, 1551, 1842, 1254, 135, 502, 889, 520, 659, 842, 950, 680, 1011, 383, 452, 322,"| __truncated__ "[0, -20, -23, -78, -184, -230, -1029, -888, -1613, -1648, -1428, -1653, -1686, -1598, -1882, -1406, -3111, -297"| __truncated__ ...
##  $ goldblue        : chr  "[2500, 2500, 2754, 4375, 5710, 7232, 8572, 9995, 11422, 12791, 14557, 16033, 17452, 19241, 20717, 22321, 24154,"| __truncated__ "[2500, 2500, 2651, 4090, 5708, 7121, 8678, 10687, 12327, 13802, 15438, 17159, 19217, 21026, 23147, 26341, 28363"| __truncated__ "[2500, 2500, 2752, 4181, 6258, 7750, 9199, 11224, 13042, 14679, 16125, 17942, 19798, 21166, 22832, 24365, 26427"| __truncated__ "[2500, 2500, 2752, 4075, 5543, 7052, 8179, 9678, 10851, 12322, 14015, 15474, 16808, 18401, 21000, 22969, 23894,"| __truncated__ ...
##  $ bkills          : chr  "[[12.634, 'C9 Smoothie', 'TSM Biofrost', ['TSM Hauntzer', 'TSM Svenskeren'], 6092, 10440], [21.253, 'C9 Smoothi"| __truncated__ "[[6.818, 'TSM Bjergsen', 'C9 Contractz', ['C9 Jensen'], 8617, 8037], [9.148, 'TSM Hauntzer', 'C9 Contractz', ['"| __truncated__ "[[3.049, 'P1 Ryu', 'FOX Akaadian', ['FOX Froggen'], 8408, 7512], [3.544, 'P1 Ryu', 'FOX Akaadian', ['FOX Frogge"| __truncated__ "[[10.351, 'FOX Looper', 'P1 zig', ['P1 Inori', 'P1 Arrow', 'P1 Adrian'], 13135, 2183], [14.954, 'FOX Keith', 'P"| __truncated__ ...
##  $ btowers         : chr  "[[23.907, 'MID_LANE', 'OUTER_TURRET'], [24.667, 'MID_LANE', 'INNER_TURRET'], [26.518, 'BOT_LANE', 'OUTER_TURRET"| __truncated__ "[[21.425, 'MID_LANE', 'INNER_TURRET'], [31.576, 'BOT_LANE', 'INNER_TURRET'], [15.905, 'MID_LANE', 'OUTER_TURRET"| __truncated__ "[[17.12, 'TOP_LANE', 'OUTER_TURRET'], [32.589, 'TOP_LANE', 'INNER_TURRET'], [33.964, 'BOT_LANE', 'OUTER_TURRET'"| __truncated__ "[[13.671, 'BOT_LANE', 'OUTER_TURRET'], [23.386, 'MID_LANE', 'INNER_TURRET'], [24.54, 'MID_LANE', 'NEXUS_TURRET'"| __truncated__ ...
##  $ binhibs         : chr  "[]" "[[36.348, 'MID_LANE'], [29.356, 'MID_LANE']]" "[]" "[[23.807, 'MID_LANE']]" ...
##  $ bdragons        : chr  "[[31.477, 'FIRE_DRAGON'], [18.906, 'AIR_DRAGON'], [25.085, 'AIR_DRAGON']]" "[[25.086, 'EARTH_DRAGON'], [18.828, 'AIR_DRAGON'], [31.234, 'EARTH_DRAGON'], [11.769, 'FIRE_DRAGON']]" "[[32.18, 'FIRE_DRAGON']]" "[[14.287, 'AIR_DRAGON']]" ...
##  $ bbarons         : chr  "[[21.947]]" "[]" "[[30.011]]" "[[21.758]]" ...
##  $ bheralds        : chr  "[]" "[[17.209]]" "[]" "[]" ...
##  $ goldred         : chr  "[2500, 2500, 2734, 4166, 5741, 7195, 8610, 10127, 11792, 13252, 14785, 16400, 18587, 21305, 23142, 24649, 26197"| __truncated__ "[2500, 2500, 2736, 4277, 5846, 7136, 8725, 10067, 11533, 13178, 14679, 16352, 17548, 18862, 20774, 22267, 24966"| __truncated__ "[2500, 2500, 2678, 4048, 5421, 6750, 8195, 9673, 11200, 13425, 15990, 17440, 18909, 20646, 22173, 23523, 25477,"| __truncated__ "[2500, 2520, 2775, 4153, 5727, 7282, 9208, 10566, 12464, 13970, 15443, 17127, 18494, 19999, 22882, 24375, 27005"| __truncated__ ...
##  $ rkills          : chr  "[[11.827, 'TSM WildTurtle', 'C9 Contractz', ['C9 Smoothie'], 7870, 1165], [12.56, 'TSM Bjergsen', 'C9 Smoothie'"| __truncated__ "[[13.099, 'C9 Smoothie', 'TSM Svenskeren', ['TSM WildTurtle', 'TSM Biofrost'], 9801, 1224], [13.192, 'C9 Sneaky"| __truncated__ "[[6.011, 'FOX Akaadian', 'P1 Ryu', ['P1 Inori'], 8873, 5731], [8.864, 'FOX Keith', 'P1 Ryu', ['P1 Arrow', 'P1 A"| __truncated__ "[[5.296, 'P1 Inori', 'FOX Akaadian', ['FOX Looper'], 3410, 8861], [7.731, 'P1 zig', 'FOX Looper', ['FOX Akaadia"| __truncated__ ...
##  $ rtowers         : chr  "[[34.173, 'BOT_LANE', 'BASE_TURRET'], [40.237, 'MID_LANE', 'NEXUS_TURRET'], [19.923, 'MID_LANE', 'OUTER_TURRET'"| __truncated__ "[[19.222, 'TOP_LANE', 'OUTER_TURRET'], [24.044, 'BOT_LANE', 'OUTER_TURRET']]" "[[36.103, 'MID_LANE', 'BASE_TURRET'], [37.984, 'MID_LANE', 'NEXUS_TURRET'], [35.969, 'MID_LANE', 'INNER_TURRET'"| __truncated__ "[[13.925, 'TOP_LANE', 'OUTER_TURRET'], [17.556, 'BOT_LANE', 'OUTER_TURRET']]" ...
##  $ rinhibs         : chr  "[[39.531, 'BOT_LANE']]" "[]" "[[36.19, 'MID_LANE']]" "[]" ...
##  $ rdragons        : chr  "[[38.477, 'ELDER_DRAGON'], [12.416, 'AIR_DRAGON']]" "[]" "[[25.937, 'AIR_DRAGON'], [15.185, 'FIRE_DRAGON']]" "[[20.939, 'FIRE_DRAGON']]" ...
##  $ rbarons         : chr  "[[36.328]]" "[[28.447]]" "[]" "[]" ...
##  $ rheralds        : chr  "[]" "[]" "[]" "[]" ...
##  $ bluetop         : chr  "Hauntzer" "Impact" "Looper" "zig" ...
##  $ bluetopchamp    : chr  "Maokai" "Nautilus" "Nautilus" "Maokai" ...
##  $ goldbluetop     : chr  "[500, 500, 502, 834, 1151, 1423, 1754, 2172, 2470, 2781, 3184, 3395, 3791, 4138, 4497, 4855, 5334, 5660, 6060, "| __truncated__ "[500, 500, 502, 740, 1124, 1499, 1711, 2095, 2365, 2731, 3037, 3360, 3676, 4113, 4840, 5190, 5716, 6275, 6705, "| __truncated__ "[500, 500, 502, 828, 1141, 1394, 1795, 2072, 2539, 2776, 2989, 3440, 3821, 4101, 4504, 4872, 5601, 5723, 6117, "| __truncated__ "[500, 500, 502, 794, 1033, 1360, 1567, 1992, 2313, 2471, 2948, 3446, 3664, 4098, 4346, 4639, 4762, 4923, 5349, "| __truncated__ ...
##  $ bluejungle      : chr  "Svenskeren" "Contractz" "Akaadian" "Inori" ...
##  $ bluejunglechamp : chr  "RekSai" "LeeSin" "RekSai" "Khazix" ...
##  $ goldbluejungle  : chr  "[500, 500, 602, 1009, 1362, 1595, 1904, 2188, 2421, 2628, 3018, 3479, 3611, 3916, 4252, 4638, 4993, 5139, 5544,"| __truncated__ "[500, 500, 602, 1009, 1363, 1537, 1854, 2468, 2851, 3074, 3602, 3937, 4690, 4990, 5553, 6000, 6302, 6510, 6968,"| __truncated__ "[500, 500, 602, 923, 1745, 2141, 2362, 2722, 3193, 3395, 3935, 4341, 4736, 4954, 5319, 5515, 6160, 6467, 6882, "| __truncated__ "[500, 500, 602, 909, 1199, 1565, 1686, 1996, 2219, 2502, 2842, 3039, 3292, 3545, 4095, 4412, 4658, 4842, 5389, "| __truncated__ ...
##  $ bluemiddle      : chr  "Bjergsen" "Jensen" "Froggen" "Ryu" ...
##  $ bluemiddlechamp : chr  "Syndra" "Syndra" "Leblanc" "Orianna" ...
##  $ goldbluemiddle  : chr  "[500, 500, 562, 947, 1070, 1569, 1845, 2182, 2445, 2930, 3281, 3640, 4039, 4279, 4618, 4917, 5357, 5765, 6208, "| __truncated__ "[500, 500, 522, 865, 1243, 1575, 2025, 2537, 2935, 3304, 3634, 4080, 4349, 4782, 5294, 5801, 6333, 6717, 7468, "| __truncated__ "[500, 500, 562, 848, 1423, 1587, 1945, 2566, 2827, 3136, 3315, 3810, 4191, 4524, 4886, 5268, 5429, 5866, 6356, "| __truncated__ "[500, 500, 559, 856, 1216, 1557, 1891, 2166, 2307, 2795, 3137, 3515, 3926, 4238, 4746, 5186, 5364, 5709, 6138, "| __truncated__ ...
##  $ blueadc         : chr  "WildTurtle" "Sneaky" "Keith" "Arrow" ...
##  $ blueadcchamp    : chr  "Kalista" "Varus" "Jhin" "Varus" ...
##  $ goldblueadc     : chr  "[500, 500, 562, 878, 1235, 1597, 1870, 2118, 2543, 2743, 3146, 3375, 3668, 4034, 4236, 4632, 5017, 5346, 5829, "| __truncated__ "[500, 500, 512, 781, 1099, 1474, 1871, 2208, 2642, 2966, 3254, 3685, 4123, 4521, 4672, 6062, 6369, 6756, 7379, "| __truncated__ "[500, 500, 562, 885, 1113, 1556, 1851, 2312, 2726, 3133, 3444, 3710, 4192, 4494, 4814, 5184, 5357, 5655, 6123, "| __truncated__ "[500, 500, 579, 865, 1278, 1593, 1885, 2222, 2554, 2923, 3276, 3447, 3763, 4184, 4942, 5381, 5544, 6081, 6594, "| __truncated__ ...
##  $ bluesupport     : chr  "Biofrost" "Smoothie" "Gate" "Adrian" ...
##  $ bluesupportchamp: chr  "Zyra" "Taric" "TahmKench" "Karma" ...
##  $ goldbluesupport : chr  "[500, 500, 526, 707, 892, 1048, 1199, 1335, 1543, 1709, 1928, 2144, 2343, 2874, 3114, 3279, 3453, 3723, 4172, 4"| __truncated__ "[500, 500, 513, 695, 879, 1036, 1217, 1379, 1534, 1727, 1911, 2097, 2379, 2620, 2788, 3288, 3643, 3926, 4389, 4"| __truncated__ "[500, 500, 524, 697, 836, 1072, 1246, 1552, 1757, 2239, 2442, 2641, 2858, 3093, 3309, 3526, 3880, 4045, 4495, 4"| __truncated__ "[500, 500, 510, 651, 817, 977, 1150, 1302, 1458, 1631, 1812, 2027, 2163, 2336, 2871, 3351, 3566, 3834, 4243, 44"| __truncated__ ...
##  $ bluebans        : chr  "['Rengar', 'Olaf', 'Janna', 'Nautilus', 'Poppy']" "['Zyra', 'Maokai', 'Ryze', 'Fiora', 'Jayce']" "['Zyra', 'Syndra', 'Ryze', 'Orianna', 'Karma']" "['Ryze', 'Kennen', 'Malzahar', 'Zyra', 'Rumble']" ...
##  $ redtop          : chr  "Impact" "Hauntzer" "zig" "Looper" ...
##  $ redtopchamp     : chr  "Shen" "Trundle" "Maokai" "Singed" ...
##  $ goldredtop      : chr  "[500, 500, 502, 797, 1168, 1500, 1848, 2168, 2522, 2853, 3111, 3546, 3819, 4284, 4740, 5125, 5517, 5778, 6045, "| __truncated__ "[500, 500, 502, 851, 1164, 1328, 1832, 2179, 2506, 2848, 3012, 3418, 3811, 4055, 4609, 4809, 5655, 5999, 6807, "| __truncated__ "[500, 500, 502, 754, 1087, 1394, 1775, 2148, 2438, 2777, 3654, 4011, 4354, 4775, 5179, 5448, 5931, 6273, 6562, "| __truncated__ "[500, 500, 502, 814, 1164, 1536, 2108, 2434, 2991, 3281, 3634, 3923, 4277, 4631, 5439, 5761, 6526, 6683, 7021, "| __truncated__ ...
##  $ redjungle       : chr  "Contractz" "Svenskeren" "Inori" "Akaadian" ...
##  $ redjunglechamp  : chr  "Khazix" "RekSai" "Rengar" "RekSai" ...
##  $ goldredjungle   : chr  "[500, 500, 622, 935, 1244, 1525, 1846, 2141, 2432, 2656, 2963, 3122, 3757, 4396, 4787, 4997, 5376, 5717, 6062, "| __truncated__ "[500, 500, 602, 995, 1387, 1597, 1910, 2034, 2431, 2810, 3223, 3561, 3684, 3863, 4353, 4600, 5071, 5486, 5801, "| __truncated__ "[500, 500, 602, 893, 1142, 1426, 1710, 2013, 2392, 2664, 3038, 3305, 3602, 3955, 4183, 4399, 4894, 5196, 5540, "| __truncated__ "[500, 500, 602, 935, 1245, 1629, 2236, 2472, 2973, 3256, 3565, 4060, 4214, 4495, 5079, 5386, 6022, 6143, 6812, "| __truncated__ ...
##  $ redmiddle       : chr  "Jensen" "Bjergsen" "Ryu" "Froggen" ...
##  $ redmiddlechamp  : chr  "Fizz" "Katarina" "Lissandra" "Anivia" ...
##  $ goldredmiddle   : chr  "[500, 500, 562, 868, 1236, 1535, 1827, 2222, 2652, 2910, 3469, 3811, 4221, 4549, 4994, 5288, 5594, 6058, 6423, "| __truncated__ "[500, 500, 542, 848, 1160, 1553, 1786, 2213, 2521, 2899, 3250, 3649, 4009, 4288, 4603, 5006, 5692, 6019, 6664, "| __truncated__ "[500, 500, 542, 893, 1057, 1363, 1652, 2126, 2473, 3392, 4139, 4455, 4794, 5127, 5514, 5890, 6350, 6746, 7087, "| __truncated__ "[500, 520, 582, 851, 1204, 1488, 1759, 2001, 2467, 2965, 3277, 3634, 4044, 4321, 5204, 5586, 6260, 6811, 7277, "| __truncated__ ...
##  $ redadc          : chr  "Sneaky" "WildTurtle" "Arrow" "Keith" ...
##  $ redadcchamp     : chr  "Ashe" "Ashe" "Varus" "Ashe" ...
##  $ goldredadc      : chr  "[500, 500, 502, 833, 1136, 1501, 1812, 2138, 2515, 2936, 3197, 3681, 4086, 4713, 5052, 5445, 5702, 6175, 6560, "| __truncated__ "[500, 500, 542, 837, 1190, 1522, 1872, 2125, 2346, 2744, 3164, 3557, 3740, 4123, 4371, 4742, 5035, 5412, 5739, "| __truncated__ "[500, 500, 522, 825, 1270, 1550, 1876, 2030, 2403, 2811, 3207, 3523, 3877, 4336, 4603, 4908, 5082, 5445, 6015, "| __truncated__ "[500, 500, 562, 848, 1181, 1505, 1814, 2180, 2394, 2657, 3014, 3365, 3678, 4062, 4403, 4720, 4865, 5126, 5581, "| __truncated__ ...
##  $ redsupport      : chr  "Smoothie" "Biofrost" "Adrian" "Gate" ...
##  $ redsupportchamp : chr  "MissFortune" "Malzahar" "Nami" "Thresh" ...
##  $ goldredsupport  : chr  "[500, 500, 546, 733, 957, 1134, 1277, 1458, 1671, 1897, 2045, 2240, 2704, 3363, 3569, 3794, 4008, 4254, 4449, 4"| __truncated__ "[500, 500, 548, 746, 945, 1136, 1325, 1516, 1729, 1877, 2030, 2167, 2304, 2533, 2838, 3110, 3513, 3715, 4122, 4"| __truncated__ "[500, 500, 510, 683, 865, 1017, 1182, 1356, 1494, 1781, 1952, 2146, 2282, 2453, 2694, 2878, 3220, 3416, 3758, 3"| __truncated__ "[500, 500, 527, 705, 933, 1124, 1291, 1479, 1639, 1811, 1953, 2145, 2281, 2490, 2757, 2922, 3332, 3600, 3896, 4"| __truncated__ ...
##  $ redbans         : chr  "['Leblanc', 'Camille', 'LeeSin', 'Varus', 'Jhin']" "['Leblanc', 'Camille', 'Rengar', 'Karma', 'Lulu']" "['Camille', 'Malzahar', 'Ashe', 'Kennen', 'Thresh']" "['Camille', 'Leblanc', 'Rengar', 'Syndra', 'Cassiopeia']" ...
##  $ address         : chr  "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002050056?gameHash=a70a111867a1816d" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002050068?gameHash=5210793878197802" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002050074?gameHash=9bb1ef5de19bfe4d" "http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002050079?gameHash=b97ed4ce330e8de1" ...
##  $ region          : Factor w/ 6 levels "All","Middle East & North Africa",..: 3 3 3 3 3 3 3 3 3 3 ...

write expert_advice data to a csv file

# write expert_advice data to a csv file
write.csv(real_lol, file = "df.csv")

extract the data we might need, and sort them by using the filter with year = 2017

# extract the data we might need, and sort them by using the filter with year = 2017
setwd("~/Documents/DATA 110/data")
bans <- read.csv("bans.csv", stringsAsFactors = FALSE)
gold <- read.csv("gold.csv", stringsAsFactors = FALSE)
names(gold) = sub('min_', '', colnames(gold))
gp1 <- subset(gold, select = -c(55:97))
ks <- read.csv("kills.csv", stringsAsFactors = FALSE)
lol1 <- read.csv("LeagueofLegends.csv", stringsAsFactors = FALSE) %>% filter(Year == 2017)
minfo <- read.csv("matchinfo.csv", stringsAsFactors = FALSE)
mons <- read.csv("monsters.csv", stringsAsFactors = FALSE)
struc <- read.csv("structures.csv", stringsAsFactors = FALSE)
mgp <-  minfo%>% subset(select = -c(Season, blueTop, redTop, blueJungle, redJungle,blueMiddle, redMiddle, blueADC, redADC, blueSupport, redSupport))%>%filter( Year == 2017) %>% left_join(gp1, by = "Address")
structures <- minfo%>% filter( Year == 2017)%>% left_join(struc, by = "Address")
kills <- minfo%>%  subset(select = -c(Season, blueTop, redTop, blueJungle, redJungle,blueMiddle, redMiddle, blueADC, redADC, blueSupport, redSupport))%>%filter( Year == 2017)  %>% left_join(ks, by = "Address")


# display the relationship between neutral objectives and times
mg <- minfo%>%  subset(select = -c(Season, blueTop, redTop, blueJungle, redJungle,blueMiddle, redMiddle, blueADC, redADC, blueSupport, redSupport))%>%filter( Year == 2017 ) %>% left_join(mons, by = "Address")
gra = mg %>% ggplot(aes(x = Type.y, y =  Time, fill = Type.y))+geom_violin()+coord_flip()+labs(title = "Neutral Objectives Taken over Time", y ="Time (mins)", x="Objective Type")+theme(legend.position = "top", legend.text = element_text(size= 8))
ggplotly(gra)

save the file to the laptop

# save the file to the laptop
write.csv(mg, file = "df1.csv")

identify the relationship between gamelength and league

# identify the relationship between gamelength and league
pda = ggplot(mg,aes(x = League,y = gamelength,fill = League))+geom_boxplot( 
                 outlier.shape=21, outlier.size=4, outlier.stroke = 1,
                 outlier.color = "blue", outlier.fill = "orange")
ggplotly(pda)

Final conclusion

https://public.tableau.com/views/project2_16259488120330/Dashboard1?:language=zh-CN&:display_count=n&:origin=viz_share_link

Summary

My data visualization is about one of the most famous and prominent video games called league of legends again. Before we enter the main content of my visualization, I prefer to briefly introduce this game and the primary strategy of this game. League of Legends is a multiplayer online battle arena (MOBA), a subgenre of strategy video games. Two teams of players compete against each other on a predefined battlefield. The player controls a character (“champion”) with a set of unique abilities from an isometric perspective. Generally speaking, the entire battlefield has been separated by three lines or paths, which also draw forth five positions in one game: top, jungle, mid, ADC (Attack Damage Carry), and support. Since we have already established the correspondence between the most advantageous position in which the conversion rate is more remarkable between gold and damage on project 1, my data visualization intends to determine the influence of neutral objectives to victory per game. Furthermore, what is the relationship between getting the neutral objectives and game length? The dataset that I found from Kaggle, a prominent LOL player, possesses four years of viewing experience. There is diversification of various variables existing in the dataset; however, we only need to familiarize several of them incorporate league, year, bResult, Redjunglechamp(a position responsible for neutral objectives), Gamelength, and dragons(neutral objectives. In order to avoid syntax error, I employ sub and tolower functions to convert the space to none and switch the capital letter to lower-case letter cleaning up my dataset. Moreover, I noticed that the ‘year’ column is defined as col_ numeric(); thus, I also exert a dated statement combined with sub to eliminate the ‘-’ and convert the percentage marks type of the data from num to date. (I forgot to convert the type of the data initiate, the graph always adds the year’s number together) Besides, I also concentrate the dataset by using select statements rearranging the column setting the condition focus on the several elements that I mentioned in the previous paragraph. Additionally, the information about neutral objectives has been concentrated in dragon columns; therefore, I also employ the sub-function to remove the square brackets. The primary reason that pursued me choosing this topic can be partly attributed to my childhood dream that I used to have an opportunity to become a professional E-sports player of League of Legends; however, due to the diversification of various unexpected issues and the pressure that came from my parents, I did not achieve it successfully. Secondly, I also mention some of the regrets in project 1, and I prefer to present them comprehensively this time.

Based on my experience of viewing the professional E-sport competition, a large number of the prominent teams would not emphasize the significance of the neutral objectives at the beginning. By retrieving my memory, I deem that the version designer, who switches the traditional neutral objectives that affect the battlefield from weak to vigorous, intends to significantly increase the ornamental value to attract more audience to watch the game. Here is what I found on the internet, and it demonstrates my opinion. Here is the URL that could confirm my memory: the version update information about the 7th. Please focus on the subtitle called element dragons, which interprets the effectiveness after killing the dragon. For instance, On slain provides the Dragon Slayer buff to each team member. Dragon Slayer’s stacks are permanent and depend on the type of dragon you killed: Infernal Drake – Infernal Tribute: +8 / 16 / 24% attack damage and ability power (Boosteria).

There are several visualizations in my project 2. First of all, I use a high chart to find out which is the most popular year of League of Legends in order to prevent the outlier and set the correct filter condition for my chart. My second visualization called neutral objectives taken over time, which can be partly demonstrated my thought that neutral objectives become important in professional competition. Moreover, I also create a boxplot that identifies the relationship between gamelength and league. Therefore, I find out that in the league which more focus on neutral objectives, their gamelength is shorter. Finally, I prefer to add another factor called jungle champion. Most of them can be cataloged as two aspects, including: aggressive and conservative. Additionally, I also add another factor called region in order to find out if the league in the same region may have the same behavior in the game? The answer is Yes. In the end, I wish I could be more precise to present my result with more detailed information, but the time and my acknowledgment limited my thought. For instance, each juggle player has multiple styles of playing games; if an aggressive player operates an aggressive champion, does it increase the rate of victory or worse. Also, the dataset that I found on the internet is highly complex for a rookie R programmer, I spend much time sorting my dataset, and the information that incorporated the dataset is tremendous. Therefore, during the rest of my career, I will be focusing on additional enhancement and attempt to coordinate with the previous knowledge.

URL: https://rpubs.com/wodeyuanbukongda/789858 URL for background information: https://boosteria.org/guides/league-legends-objectives-guide URL for Tableau (hope it works): https://public.tableau.com/views/project2_16259488120330/Dashboard1?:language=zh-CN&:display_count=n&:origin=viz_share_link