Last active
August 29, 2015 14:22
-
-
Save hezila/28db6f613b74d3adf103 to your computer and use it in GitHub Desktop.
KDD Cup 2015 Rank
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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")] %>% | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment