Created
November 23, 2015 19:31
-
-
Save aammd/52b7f7bc02d7ee63be7d to your computer and use it in GitHub Desktop.
quick idea for getting country publication info
This file contains hidden or 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
library(rvest) | |
library(magrittr) | |
pubs <- read_html("http://www.scimagojr.com/countryrank.php") %>% | |
html_node(".tabla_datos") %>% | |
html_table(row.names = FALSE) | |
library(tidyr) | |
library(dplyr) | |
extract_numeric | |
pubs<- pubs[,-(1:2)] | |
head(pubs) | |
names(pubs)[1] <- "Country" | |
apply(pubs, 2, function(x) gsub("\\.", "", x)) | |
pubs %>% | |
group_by(Country) %>% | |
mutate_each(funs(extract_numeric)) | |
str(pubs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment