有時(shí)候用endnote導(dǎo)入文獻(xiàn)后顯示的是期刊全稱体谒,而用到縮寫(xiě)時(shí)候就需要去一些網(wǎng)站上一個(gè)個(gè)搜索潮售,比如CASSI, LetPub项鬼、Pubumed等網(wǎng)站,或者Y叔公號(hào)里直接回復(fù)户誓,而逛Github時(shí)候突然發(fā)現(xiàn)abbrevr這小R包中可以很快批量實(shí)現(xiàn)這個(gè)需求尚洽,在此記錄一下。
List of Title Word Abbreviations (LTWA)
安裝
# install.packages("remotes")
remotes::install_github("patrickbarks/abbrevr")
查詢期刊縮寫(xiě)
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號(hào)批量獲取
這里就需要結(jié)合另一個(gè)R包rcrossref, 這個(gè)包主要功能就是利用API接口根據(jù)doi號(hào)提取文獻(xiàn)信息(具體原理可自行摸索)绒疗,然后提取出文獻(xiàn)全稱再批量轉(zhuǎn)化為縮寫(xiě)侵歇,一步到位,示例如下:
# 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)前版本說(shuō)明:
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”)