Created
December 18, 2012 02:07
-
-
Save karthik/4324375 to your computer and use it in GitHub Desktop.
How to grab dois from a bibtex file.
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
library(bibtex) | |
library(plyr) | |
# If you don't have the above mentioned packages, just run | |
# install.packages(package_name) before running this code. | |
# | |
# My bib file that I've used as an example | |
bib_raw <- read.bib('~/Desktop/citation_counts/PLOS_refs.bib') | |
# Once read in, the doi is a slot under each list item. | |
dois <- llply(bib_raw, function(x) { | |
return(x$doi) | |
}) | |
# remove the NULLs (when objects like web pages don't have dois) | |
dois <- compact(dois) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment