knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) options(digits = 4, width = 120)
An outline of the ISO 4 rules for abbreviation can be found here, and a text file containing the ISSN List of Title Word Abbreviations (LTWA) can be found here.
Install the development version from GitHub with:
# install.packages("remotes") remotes::install_github("patrickbarks/abbrevr")
Abbreviate individual titles:
library(abbrevr) AbbrevTitle("Transactions of the American Fisheries Society") AbbrevTitle("Deutsche Medizinische Wochenschrift") AbbrevTitle("L'Intermédiaire des Mathématiciens")
Use rcrossref library to extract citation info for a set of DOIs, then abbreviate journal titles using abbrevr:
# load rcrossref library(rcrossref) # DOIs for a set of scientific publications dois <- c( "10.1577/T09-174.1", "10.1371/journal.pone.0075858", "10.1111/1365-2435.12359", "10.1111/jeb.12823", "10.1111/1365-2745.12937" ) # use rcrossref::cr_cn() to get citation info for DOIs citations <- rcrossref::cr_cn(dois, format = "citeproc-json") # extract journal titles from citation info titles <- sapply(citations, function(x) x$`container-title`, USE.NAMES = FALSE) # use abbrevr::AbbrevTitle() to abbreviate titles titles_short <- sapply(titles, abbrevr::AbbrevTitle, USE.NAMES = FALSE) # print data.frame data.frame( doi = dois, title = titles, title_short = titles_short, stringsAsFactors = FALSE ) #> doi title title_short #> 10.1577/T09-174.1 Transactions of the American Fisheries Society Trans. Am. Fish. Soc. #> 10.1371/journal.pone.0075858 PLoS ONE PLoS ONE #> 10.1111/1365-2435.12359 Functional Ecology Funct. Ecol. #> 10.1111/jeb.12823 Journal of Evolutionary Biology J. Evol. Biol. #> 10.1111/1365-2745.12937 Journal of Ecology J. Ecol.
The current version...
Also beware of abbreviation rules that are difficult to implement algorithmically, e.g.:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.