Imports .bib files and cleans BibTeX references using the function bib2df::bib2df().

read_bib(
  path = ".",
  tags = c("bibtexkey", "category", "author", "title", "year", "volume", "booktitle",
    "editor", "journal", "pages", "institution", "publisher", "doi", "url", "abstract",
    "keywords", "annote"),
  categories = NULL,
  pattern = NULL
)

Arguments

path

a character of length 1. The name of the folder containing .bib files to read. All .bib files found in this folder will be imported.

tags

a vector of characters. BibTeX fields to extract (e.g. "author", "year", "title", etc.). See Details section.

categories

(optional) a vector of characters. Publications categories to import (e.g. "article", "book", etc.). See Details section. Default is NULL (all publications will be retrieved).

pattern

(optional) a vector of characters. This argument is used to select .bib files. For instance, if all .bib files start with CESAB- (i.e. CESAB-***.bib), user can add pattern = 'CESAB-' to only read these .bib files.

Value

A data.frame with references fields in columns and references in rows.

Details

Valid tags values:

  • category: type of publication

  • bibtexkey: unique identifier of the publication

  • annote: user annotations

  • author: authors names

  • booktitle: title of the book

  • chapter: chapter number (for book chapter)

  • crossref: Crossref identifier

  • edition: edition number

  • editor: editors names

  • institution: institution name (for thesis and report)

  • journal: journal name (for scientific article)

  • month: month of the date of publication

  • number: issue number

  • pages: pages range or pages number or article number

  • publisher: publisher name (i.e. Elsevier, etc.)

  • series: series name

  • title: title of the publication

  • volume: volume number

  • year: year of the date of publication

  • doi: DOI (without https://doi.org/)

  • abstract: abstract of the publications

  • keywords: authors keywords

  • url: URL of the only publication

  • isbn: ISSN identifier of the book/journal

  • pmid: PMID identifier

Valid categories values:

  • article: scientific paper

  • book: book

  • incollection: book chapter

  • inproceedings: proceeding article

  • phdthesis: PhD thesis

  • techreport: technical report

Examples

path_to_bibs <- system.file("extdata", package = "rbibtools")
refs <- read_bib(path = path_to_bibs)
#> Warning: `as_data_frame()` was deprecated in tibble 2.0.0.
#>  Please use `as_tibble()` instead.
#>  The signature and semantics have changed, see `?as_tibble`.
#>  The deprecated feature was likely used in the bib2df package.
#>   Please report the issue to the authors.