Created
February 15, 2017 11:17
-
-
Save mbannert/edb0de42ac09eed79ec6285358325b83 to your computer and use it in GitHub Desktop.
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(openxlsx) | |
library(rvest) | |
journals <- read_html("https://www.aeaweb.org/econlit/journal_list.php") | |
j <- journals %>% | |
html_nodes(".journal") %>% | |
html_text() | |
dflist <- lapply(j,function(x){ | |
jr <- unlist(strsplit(x,"\n")) | |
if(length(jr) == 3) jr[4:5] <- NA | |
if(length(jr) == 4) jr[5] <- NA | |
dframe <- data.frame(t(jr),stringsAsFactors = F) | |
dframe | |
}) | |
journal_df <- do.call("rbind",dflist) | |
names(journal_df) <- c("Journal","ISSN","time span","notes1","notes2") | |
nrow(journal_df) | |
length(unique(journal_df$ISSN)) | |
write.xlsx(journal_df, file = "journal_list_aea.xlsx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment