Advertisement
Guest User

Untitled

a guest
Apr 30th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 8.46 KB | None | 0 0
  1. initialise <- function() {
  2.   print("Pulling heroes list")
  3.   heroestable <- readHTMLTable(getURLContent("http://dotabuff.com/heroes/winning", useragent = "Chrome 36.0.1944.0", followlocation = TRUE),stringsAsFactors = FALSE)[[1]]   #[[1]] means grab only the 1st table
  4.   names(heroestable) <- c("ID",names(heroestable)[-5]) #Columns are wrong; move all to right and set left-most to ID
  5.  
  6. > dput(head(subsetheroes))
  7. structure(list(ID = c("", "", "", ""), Hero = c("Slardar", "Doom",
  8. "Bounty Hunter", "Chen"), `Win Rate` = c("52.32%", "49.10%",
  9. "45.29%", "44.34%"), `Matches Played` = c("2,741,067", "3,202,905",
  10. "4,146,758", "546,677"), `KDA Ratio` = c("2.42", "2.50", "2.17",
  11. "1.72"), `Wraith King` = c("-0.63%", "-3.57%", "-1.56%", "-0.27%"
  12. ), Abaddon = c("-2.16%", "1.72%", "-2.67%", "-0.51%"), Lich = c("-3.01%",
  13. "-0.74%", "-1.43%", "-1.35%"), Lycan = c("2.40%", "-3.12%", "0.51%",
  14. "-0.81%"), `Centaur Warrunner` = c("-0.75%", "0.03%", "-2.17%",
  15. "-0.24%"), Zeus = c("-3.29%", "-1.76%", "-3.33%", "-0.33%"),
  16.     Necrophos = c("-1.93%", "-0.88%", "-2.19%", "0.03%"), `Death Prophet` = c("-1.83%",
  17.     "-2.62%", "0.63%", "-1.33%"), Terrorblade = c("-1.35%", "-4.72%",
  18.     "-1.13%", "-0.93%"), `Vengeful Spirit` = c("-1.65%", "-1.40%",
  19.     "-2.03%", "-1.22%"), Omniknight = c("-1.79%", "0.77%", "-3.72%",
  20.     "-0.45%"), Warlock = c("-1.65%", "-1.30%", "-0.39%", "-1.56%"
  21.     ), Luna = c("-2.56%", "-2.31%", "-1.67%", "-0.44%"), Mirana = c("-1.19%",
  22.     "0.20%", "1.16%", "1.71%"), Dazzle = c("-1.43%", "0.37%",
  23.     "-1.19%", "0.30%"), `Treant Protector` = c("-0.18%", "-0.93%",
  24.     "-1.98%", "-0.16%"), Viper = c("-1.03%", "-2.35%", "-1.37%",
  25.     "-1.53%"), Venomancer = c("-3.87%", "-1.49%", "-2.21%", "0.67%"
  26.     ), Riki = c("1.12%", "-3.32%", "0.97%", "-3.70%"), `Crystal Maiden` = c("-1.96%",
  27.     "-0.56%", "-2.65%", "-0.74%"), Spectre = c("-0.59%", "1.40%",
  28.     "-0.26%", "2.69%"), Ursa = c("1.02%", "-4.86%", "-1.45%",
  29.     "-4.87%"), Axe = c("-1.55%", "0.89%", "-2.22%", "-1.62%"),
  30.     `Witch Doctor` = c("-2.17%", "-1.32%", "-0.08%", "-0.67%"
  31.     ), Bloodseeker = c("-0.07%", "-3.13%", "-3.57%", "-1.41%"
  32.     ), Disruptor = c("-2.03%", "-0.20%", "-0.29%", "0.07%"),
  33.     Slardar = c(NA, "-0.81%", "-3.60%", "-2.67%"), Silencer = c("-1.61%",
  34.     "-0.37%", "0.72%", "1.13%"), Tidehunter = c("-3.59%", "0.88%",
  35.     "-2.82%", "-0.11%"), `Shadow Shaman` = c("-2.50%", "-1.57%",
  36.     "-1.50%", "-0.88%"), `Drow Ranger` = c("-0.90%", "-4.53%",
  37.     "-0.09%", "-4.19%"), Sven = c("-1.46%", "-1.07%", "-1.74%",
  38.     "-3.18%"), Phoenix = c("-1.72%", "0.61%", "-0.78%", "0.72%"
  39.     ), Jakiro = c("-2.16%", "-0.66%", "-1.26%", "-2.20%"), `Ogre Magi` = c("-1.41%",
  40.     "-0.49%", "-2.32%", "-1.45%"), Earthshaker = c("-2.12%",
  41.     "0.25%", "-2.21%", "-1.48%"), `Ancient Apparition` = c("-1.88%",
  42.     "0.05%", "0.31%", "-0.72%"), Brewmaster = c("-0.25%", "0.98%",
  43.     "-0.69%", "-1.93%"), `Sand King` = c("0.75%", "0.51%", "-0.82%",
  44.     "-1.91%"), Slark = c("-0.28%", "0.54%", "-2.14%", "-2.13%"
  45.     ), `Phantom Lancer` = c("-0.05%", "-2.08%", "0.61%", "-1.61%"
  46.     ), Weaver = c("0.78%", "0.66%", "1.32%", "-0.28%"), `Spirit Breaker` = c("0.85%",
  47.     "-1.83%", "-2.49%", "-2.40%"), Sniper = c("-1.75%", "-2.20%",
  48.     "-0.41%", "-1.89%"), Bristleback = c("0.90%", "0.49%", "-0.87%",
  49.     "-1.63%"), Clockwerk = c("-2.69%", "0.29%", "-1.60%", "1.85%"
  50.     ), `Keeper of the Light` = c("-0.77%", "0.05%", "-0.24%",
  51.     "-0.59%"), `Night Stalker` = c("0.82%", "-2.31%", "-1.06%",
  52.     "-2.69%"), Razor = c("-1.83%", "-1.80%", "-2.96%", "-2.92%"
  53.     ), Doom = c("-0.21%", NA, "0.39%", "0.19%"), Invoker = c("-0.77%",
  54.     "-1.87%", "1.14%", "1.20%"), Lion = c("-1.69%", "-0.26%",
  55.     "-2.44%", "-1.64%"), `Nyx Assassin` = c("0.66%", "0.04%",
  56.     "-0.11%", "-0.55%"), Juggernaut = c("-1.44%", "-0.69%", "-0.71%",
  57.     "0.55%"), `Shadow Fiend` = c("-1.13%", "-0.89%", "0.44%",
  58.     "-0.25%"), Medusa = c("-1.33%", "-1.12%", "-0.02%", "0.17%"
  59.     ), `Elder Titan` = c("-2.21%", "-0.48%", "-0.00%", "0.93%"
  60.     ), Kunkka = c("-0.20%", "1.17%", "0.53%", "-1.26%"), `Faceless Void` = c("1.28%",
  61.     "0.56%", "-1.82%", "-1.57%"), Pudge = c("1.12%", "-0.78%",
  62.     "-1.55%", "-0.25%"), Undying = c("-0.28%", "-0.98%", "0.96%",
  63.     "-1.65%"), Pugna = c("-1.15%", "-0.96%", "-0.26%", "-0.86%"
  64.     ), `Dark Seer` = c("-0.79%", "0.44%", "-1.07%", "0.09%"),
  65.     Huskar = c("0.77%", "-2.60%", "-3.34%", "-3.43%"), `Dragon Knight` = c("-2.47%",
  66.     "-1.06%", "-2.10%", "-2.43%"), `Ember Spirit` = c("-0.61%",
  67.     "0.17%", "-0.28%", "0.78%"), Lifestealer = c("-0.33%", "-1.12%",
  68.     "-0.52%", "-2.23%"), `Nature's Prophet` = c("0.75%", "-0.28%",
  69.    "0.94%", "0.48%"), Enigma = c("-1.97%", "-0.57%", "-1.97%",
  70.    "-0.64%"), Tusk = c("-0.15%", "-1.32%", "-1.78%", "-2.51%"
  71.    ), Leshrac = c("-1.42%", "-0.70%", "-0.72%", "-0.70%"), Meepo = c("0.07%",
  72.    "-3.51%", "-4.06%", "-1.50%"), Beastmaster = c("-0.87%",
  73.    "-0.83%", "-1.31%", "-0.57%"), Lina = c("-1.53%", "-0.66%",
  74.    "-1.78%", "-2.42%"), `Troll Warlord` = c("-0.45%", "-2.66%",
  75.    "-1.95%", "-2.64%"), Tiny = c("-0.79%", "-0.13%", "-2.97%",
  76.    "-1.26%"), Bane = c("-0.17%", "-0.54%", "-1.84%", "-1.44%"
  77.    ), `Bounty Hunter` = c("2.00%", "-1.74%", NA, "-1.32%"),
  78.    `Naga Siren` = c("-1.29%", "-0.18%", "-4.00%", "-2.28%"),
  79.    Timbersaw = c("-0.95%", "0.71%", "-0.15%", "-0.67%"), `Templar Assassin` = c("1.47%",
  80.    "-0.57%", "0.56%", "-0.84%"), Batrider = c("-1.31%", "-0.37%",
  81.    "-1.01%", "-1.43%"), `Skywrath Mage` = c("-1.29%", "-1.64%",
  82.    "-0.85%", "-0.74%"), `Chaos Knight` = c("-0.80%", "-2.83%",
  83.    "-2.53%", "-2.08%"), Visage = c("-1.23%", "-1.08%", "-0.99%",
  84.    "-1.24%"), `Legion Commander` = c("0.17%", "-0.81%", "-2.79%",
  85.    "-1.06%"), `Storm Spirit` = c("-0.23%", "-0.15%", "-1.99%",
  86.    "0.10%"), Rubick = c("-0.84%", "-0.09%", "-0.56%", "0.73%"
  87.    ), Gyrocopter = c("-2.32%", "0.69%", "-0.16%", "-1.81%"),
  88.    Magnus = c("-1.08%", "1.13%", "-1.79%", "-1.21%"), Clinkz = c("1.09%",
  89.    "-2.47%", "1.77%", "-2.37%"), Chen = c("1.16%", "-1.58%",
  90.    "-0.94%", NA), Puck = c("-1.70%", "0.68%", "-1.68%", "0.32%"
  91.    ), `Outworld Devourer` = c("-2.36%", "-1.32%", "-1.68%",
  92.    "-0.99%"), Windranger = c("-0.95%", "0.95%", "-0.92%", "-0.03%"
  93.    ), `Lone Druid` = c("0.22%", "-2.41%", "-0.27%", "-0.34%"
  94.    ), `Phantom Assassin` = c("0.54%", "-0.21%", "-2.05%", "-2.81%"
  95.    ), Enchantress = c("-0.72%", "-0.59%", "-1.15%", "-1.60%"
  96.    ), Tinker = c("-1.17%", "0.89%", "-1.54%", "0.41%"), Morphling = c("-0.19%",
  97.    "-0.14%", "-1.56%", "0.33%"), `Queen of Pain` = c("-0.77%",
  98.    "-0.42%", "-1.90%", "-1.19%"), Alchemist = c("0.90%", "-2.27%",
  99.    "1.50%", "-0.16%"), `Shadow Demon` = c("-0.50%", "-0.69%",
  100.    "-0.44%", "-1.17%"), `Anti-Mage` = c("2.49%", "-1.69%", "-0.84%",
  101.    "-1.18%"), Io = c("0.05%", "-1.76%", "-1.67%", "0.05%"),
  102.    Broodmother = c("3.19%", "-1.42%", "1.07%", "-3.50%"), `Earth Spirit` = c("-0.17%",
  103.    "-1.18%", "-1.14%", "-1.29%")), .Names = c("ID", "Hero",
  104. "Win Rate", "Matches Played", "KDA Ratio", "Wraith King", "Abaddon",
  105. "Lich", "Lycan", "Centaur Warrunner", "Zeus", "Necrophos", "Death Prophet",
  106. "Terrorblade", "Vengeful Spirit", "Omniknight", "Warlock", "Luna",
  107. "Mirana", "Dazzle", "Treant Protector", "Viper", "Venomancer",
  108. "Riki", "Crystal Maiden", "Spectre", "Ursa", "Axe", "Witch Doctor",
  109. "Bloodseeker", "Disruptor", "Slardar", "Silencer", "Tidehunter",
  110. "Shadow Shaman", "Drow Ranger", "Sven", "Phoenix", "Jakiro",
  111. "Ogre Magi", "Earthshaker", "Ancient Apparition", "Brewmaster",
  112. "Sand King", "Slark", "Phantom Lancer", "Weaver", "Spirit Breaker",
  113. "Sniper", "Bristleback", "Clockwerk", "Keeper of the Light",
  114. "Night Stalker", "Razor", "Doom", "Invoker", "Lion", "Nyx Assassin",
  115. "Juggernaut", "Shadow Fiend", "Medusa", "Elder Titan", "Kunkka",
  116. "Faceless Void", "Pudge", "Undying", "Pugna", "Dark Seer", "Huskar",
  117. "Dragon Knight", "Ember Spirit", "Lifestealer", "Nature's Prophet",
  118. "Enigma", "Tusk", "Leshrac", "Meepo", "Beastmaster", "Lina",
  119. "Troll Warlord", "Tiny", "Bane", "Bounty Hunter", "Naga Siren",
  120. "Timbersaw", "Templar Assassin", "Batrider", "Skywrath Mage",
  121. "Chaos Knight", "Visage", "Legion Commander", "Storm Spirit",
  122. "Rubick", "Gyrocopter", "Magnus", "Clinkz", "Chen", "Puck", "Outworld Devourer",
  123. "Windranger", "Lone Druid", "Phantom Assassin", "Enchantress",
  124. "Tinker", "Morphling", "Queen of Pain", "Alchemist", "Shadow Demon",
  125. "Anti-Mage", "Io", "Broodmother", "Earth Spirit"), row.names = c(27L,
  126. 50L, 78L, 92L), class = "data.frame")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement