abbr_bib: Journal field abbreviation of BibTeX file.

View source: R/abbr_bib.R

abbr_bibR Documentation

Journal field abbreviation of BibTeX file.

Description

Input Bib file with complete journal, output a .bib file and return a data object.

Input Bib file with complete journal, output a .bib file, this function only carries out journal abbreviations, and the rest is output as it is.

Usage

abbr_bib(
  file,
  out.file = tempfile(fileext = ".bib"),
  author.connect = c("nothing", "\\\\&", "&", "and"),
  user.csv = "",
  ...
)

abbr_bib_only_journal(
  file,
  out.file = tempfile(fileext = ".bib"),
  user.csv = "",
  ...
)

Arguments

file

character, file path to write the .bib file.

out.file

character, file path to write the .bib file.

author.connect

character, what symbols are used to connect multiple authors, 'nothing','\\&', '&', 'and', where 'nothing' stand for do nothing(default).

user.csv

character, csv file path, Users can customize the path of journal abbreviation. The csv file requires semicolon to segment data without header. The first column is the full name of the journal and the second column is the journal abbreviation.

...

(generalized), Parameters from data.table::fread.

Value

output a new Bib file and return a data.table object.

Examples

require(journalabbr)
path <- system.file("extdata", "testfile_2.bib", package = "journalabbr", mustWork = TRUE)
temptab <- abbr_bib(file = path, out.file = tempfile(fileext = ".bib"))

# add user csv
csvpath <- system.file("extdata", "myabbr.csv", package = "journalabbr", mustWork = TRUE)
temptab1 <- abbr_bib(file = path, out.file = tempfile(fileext = ".bib"), user.csv = csvpath)

# no return value
abbr_bib_only_journal(file = path, out.file = tempfile(fileext = ".bib"), user.csv = csvpath)


journalabbr documentation built on Aug. 9, 2022, 5:05 p.m.