Last active
July 14, 2017 09:24
-
-
Save rossmounce/b51d8a841e4e3049992cdb0280b3ea29 to your computer and use it in GitHub Desktop.
How many freely accessible works do Nobel prize winners have?
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
install.packages('rorcid') | |
install.packages('roadoi') | |
library(roadoi) | |
library(rorcid) | |
#Example ORCID given is that of Carol Greider, American molecular biologist | |
an.ORCID.ID <- "0000-0002-5494-8126" | |
#This step gets all works publicly known to ORCID to be associated to this person | |
out <- works(orcid_id(your.ORCID.ID)) | |
#This step filters the list of works to only those which have a DOI | |
ids <- dplyr::bind_rows(Filter( | |
Negate(is.null), | |
out$data$`work-external-identifiers.work-external-identifier` | |
)) | |
doisonly <- ids[ids$`work-external-identifier-type` == "DOI", ] | |
doisonly$`work-external-identifier-id.value` <- gsub("^","http://doi.org/",doisonly$`work-external-identifier-id.value`) | |
doisonly$`work-external-identifier-id.value` <- gsub("DOI: ","",doisonly$`work-external-identifier-id.value`) | |
uniquedois <- unique(doisonly$`work-external-identifier-id.value`) | |
length(uniquedois) #48 works with a DOI registered to this ORCID | |
#The OADOI API requests that you kindly supply your email address so they know who is using the service and other reasons, see here for more: https://github.com/njahn82/roadoi | |
your.email.address <- "[email protected]" | |
#This is the magic step. This OA compliance checking API isn't 100% accurate. Always do manual checks in addition if it's important. | |
x <- roadoi::oadoi_fetch(dois = uniquedois, | |
email = your.email.address, | |
.progress = "text") | |
#Quick summary | |
table(x$is_free_to_read) | |
# FALSE TRUE | |
# 28 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment