Package 'bibtex'

Title: Bibtex Parser
Description: Utility to parse a bibtex file.
Authors: Romain Francois [aut, cph] (<https://orcid.org/0000-0002-2444-4226>, principal developer of bibtex R package), James Joseph Balamuta [ctb, cre] , Diego Hernangómez [aut] , Scott Chamberlain [ctb] , Kurt Hornik [ctb] , Brian Ripley [ctb] (compilation fixes), Michael Koohafkan [ctb], Mathew W. McLean [ctb]
Maintainer: James Joseph Balamuta <[email protected]>
License: GPL (>= 2)
Version: 0.5.1
Built: 2024-08-29 23:17:45 UTC
Source: https://github.com/ropensci/bibtex

Help Index


convenience wrapper around .External call

Description

This is a convenience function for packages that do need to call the internal functionality of read.bib but does different processing. This is a simple wrapper around the .External code used by read.bib

Usage

do_read_bib(file, encoding = "unknown", srcfile)

Arguments

file

file name

encoding

encoding

srcfile

Deprecated

Details

The parser is greatly inspired from the ‘⁠bibparse⁠’ library.

See Also

bibentry


bibtex parser

Description

Parser for bibliography databases written in the bib format.

Usage

read.bib(
  file = findBibFile(package),
  package = "bibtex",
  encoding = "unknown",
  header,
  footer
)

Arguments

file

bib file to parse. By default, the file ‘REFERENCES.bib’ in the root directory of the package given by the package argument is used.

package

package from which we want to read the bibliography. Only used if file is unspecified. Core R packages (base, datasets, graphics, grDevices, methods, stats, stats4, tools and utils) are treated specially: this package contains bibtex entries for these packages.

encoding

encoding

header

DEPRECATED.

footer

DEPRECATED

Value

An object of class "bibentry", similar to those obtained by the bibentry function.

References

Nelson H. F. Beebe. bibparse 1.04. 1999. http://www.math.utah.edu/~beebe/

Examples

## this package has a REFERENCES.bib file
bib <- read.bib(package = "bibtex")

## bibtex collects bibtex entries for R base packages
base.bib <- read.bib(package = "base")

Generate a Bibtex File from Package Citations

Description

Generates a Bibtex file from a list of packages or all the installed packages. It is useful for adding relevant citations in Sweave documents.

Usage

write.bib(entry, file = "Rpackages.bib", append = FALSE, verbose = TRUE)

Arguments

entry

a bibentry object or a character vector of package names. If NULL, then the list of all installed packages is used.

file

output Bibtex file.

append

logical. If TRUE content is appended to the file.

verbose

a logical to toggle verbosity.

Value

the list of Bibtex objects – invisibly.

Author(s)

Renaud Gaujoux, based on the function Rpackages.bib from Achim Zeileis (see References).

References

[R] Creating bibtex file of all installed packages? Achim Zeileis. R-help mailing list.

Examples

write.bib(c("bibtex", "utils", "tools"), file = "references")
bibs <- read.bib("references.bib")
write.bib(bibs, "references2.bib")
md5 <- tools::md5sum(c("references.bib", "references2.bib"))
md5[1] == md5[2]