bib2df: Parse a BibTeX file to a 'tibble'

View source: R/bib2df.R

bib2dfR Documentation

Parse a BibTeX file to a tibble

Description

The BibTeX file is read, parsed, tidied and written to a tibble

Usage

bib2df(file, separate_names = FALSE, merge_lines = FALSE)

Arguments

file

character, path or URL to a .bib file.

separate_names

logical, should authors' and editors' names be separated into first and given name?

merge_lines

logical, set to FALSE by default. If set to TRUE identifies entries that span several lines and merges them

Details

For simplicity bib2df() unifies the reading, parsing and tidying of a BibTeX file while being aware of a standardized output format, different BibTeX styles and missing values in the BibTeX file.

When separate_names = TRUE, the respective columns contain a data.frame for each row. When FALSE, the respective columns contain character strings.

Value

A tibble.

Author(s)

Philipp Ottolinger

See Also

df2bib

Examples

# Read from .bib file:
path <- system.file("extdata", "bib2df_testfile_3.bib", package = "bib2df")
bib <- bib2df(path)
str(bib)

# Read from .bib file and separate authors' and editors' names:
bib <- bib2df(path, separate_names = TRUE)
str(bib)

ropensci/bib2df documentation built on April 12, 2024, 4:43 p.m.