write_dt2bib: Export a BibTeX 'data.table' to a .bib file.

View source: R/write_dt2bib.R

write_dt2bibR Documentation

Export a BibTeX data.table to a .bib file.

Description

The BibTeX data.table is written to a .bib file.

Usage

write_dt2bib(
  dt,
  file = tempfile(fileext = ".bib"),
  columns = get_delcolumns(),
  indent = "\t"
)

Arguments

dt

data.table, in the format as returned by read_bib2dt.

file

character, file path to write the .bib file.

columns

character vector, names of the columns to exclude from the output. a default list of columns will be used from get_delcolumns.

indent

character, the indentation to use for the .bib file. Default is "\t"

Value

file as a character string, invisibly.

Examples

# Read from .bib file:
require(journalabbr)
file <- system.file("extdata", "testfile_2.bib", package = "journalabbr", mustWork = TRUE)
bib <- read_bib2dt(file)

# Write to .bib file:
write_dt2bib(bib, file = tempfile(fileext = ".bib"))

zoushucai/journalabbr documentation built on Dec. 6, 2024, 4:41 p.m.