Skip to content

Instantly share code, notes, and snippets.

@hezila
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hezila/28db6f613b74d3adf103 to your computer and use it in GitHub Desktop.
Save hezila/28db6f613b74d3adf103 to your computer and use it in GitHub Desktop.
KDD Cup 2015 Rank
# from http://qiita.com/Keiku/items/80656e99ca5e71dc1f43
library(rvest)
library(stringr)
library(dplyr)
library(tidyr)
library(reshape2)
library(magrittr)
submission_rank <- html("https://www.kddcup2015.com/submission-rank.html")
submission_rank_list <- submission_rank %>%
html_nodes("tr") %>%
html_text() %>%
str_replace_all(., "\t", "") %>%
str_replace_all(., "\r", "") %>%
str_split(., "\n") %>%
melt() %>%
subset(., value!="") %>%
subset(., L1<=100) %>%
mutate(key = rep(head(.$value,6),100)) %>%
spread(key, value) %>%
.[-1,] %>%
.[c("#",
"Δrank",
"team name",
"score",
"Entries",
"Last Submission UTC")] %>%
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment