Skip to content

Instantly share code, notes, and snippets.

@dwinter
Created July 12, 2013 11:23
Show Gist options
  • Save dwinter/5983728 to your computer and use it in GitHub Desktop.
Save dwinter/5983728 to your computer and use it in GitHub Desktop.
Fetch abstracts using rentrez
library(rentrez) #written for devel-version on github
fetch_abstract <- function(doi){
search <- entrez_search(term=paste(doi, "[doi]", sep=""), db="pubmed")
rec <- parse_pubmed_xml(entrez_fetch(db="pubmed", id=search$ids, rettype="xml"))
return(rec$abstract)
}
fetch_abstract("10.1111/j.1461-0248.2010.01509.x")
@dfalster
Copy link

Beautiful. Make sure you install development version of package github

library(devtools)
install_github("rentrez", "ropensci")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment