利用abbrevr包批量輸出期刊縮寫

有時候用endnote導(dǎo)入文獻后顯示的是期刊全稱,而用到縮寫時候就需要去一些網(wǎng)站上一個個搜索,比如CASSI, LetPub、Pubumed等網(wǎng)站,或者Y叔公號里直接回復(fù),而逛Github時候突然發(fā)現(xiàn)abbrevr這小R包中可以很快批量實現(xiàn)這個需求,在此記錄一下。

List of Title Word Abbreviations (LTWA)

安裝

# install.packages("remotes")
remotes::install_github("patrickbarks/abbrevr")

查詢期刊縮寫

library(abbrevr)

AbbrevTitle("Transactions of the American Fisheries Society")
#> [1] "Trans. Am. Fish. Soc."
AbbrevTitle("Deutsche Medizinische Wochenschrift")
#> [1] "Dtsch. Med. Wochenschr."
AbbrevTitle("L'Intermédiaire des Mathématiciens")
#> [1] "Interme?d. Math."

根據(jù)doi號批量獲取

這里就需要結(jié)合另一個R包rcrossref, 這個包主要功能就是利用API接口根據(jù)doi號提取文獻信息(具體原理可自行摸索),然后提取出文獻全稱再批量轉(zhuǎn)化為縮寫,一步到位,示例如下:

# 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
)
image-20221207150254677

附當(dāng)前版本說明:

The current version…

  • only handles common articles, prepositions, and conjunctions in English, German, and French (ISO 4 dictates that these classes should generally be ommitted, with exceptions noted in the document linked above)
  • omits all punctuation except for hyphens (ISO 4 dictates all punctuation except commas should be retained, but periods should be replaced with commas)
  • does not omit generic identifiers such as “Section”, “Series”, or “Part” (ISO 4 dictates such generics should be ommitted unless required for identification)
  • may not retain all diacritic marks (ISO 4 dictates that all diacritic marks should be retained)

Also beware of abbreviation rules that are difficult to implement algorithmically, e.g.:

  • names of persons should not be abbreviated
  • prepositions and articles should be retained if they are integral parts of proper names (e.g. “Los Alamos”) or locutions (e.g. “in vivo”)
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容