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]
|
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 |
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
do_read_bib(file, encoding = "unknown", srcfile)
do_read_bib(file, encoding = "unknown", srcfile)
file |
file name |
encoding |
encoding |
srcfile |
Deprecated |
The parser is greatly inspired from the ‘bibparse’ library.
Parser for bibliography databases written in the bib format.
read.bib( file = findBibFile(package), package = "bibtex", encoding = "unknown", header, footer )
read.bib( file = findBibFile(package), package = "bibtex", encoding = "unknown", header, footer )
file |
bib file to parse. By default, the file
‘REFERENCES.bib’ in the root directory of the package given by
the |
package |
package from which we want to read the bibliography.
Only used if |
encoding |
encoding |
header |
DEPRECATED. |
footer |
DEPRECATED |
An object of class "bibentry"
, similar to those obtained by the
bibentry
function.
Nelson H. F. Beebe. bibparse 1.04. 1999. http://www.math.utah.edu/~beebe/
## 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")
## 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")
Generates a Bibtex file from a list of packages or all the installed packages. It is useful for adding relevant citations in Sweave documents.
write.bib(entry, file = "Rpackages.bib", append = FALSE, verbose = TRUE)
write.bib(entry, file = "Rpackages.bib", append = FALSE, verbose = TRUE)
entry |
a |
file |
output Bibtex file. |
append |
logical. If |
verbose |
a logical to toggle verbosity. |
the list of Bibtex objects – invisibly.
Renaud Gaujoux, based on the function Rpackages.bib
from Achim Zeileis (see References).
[R] Creating bibtex file of all installed packages? Achim Zeileis. R-help mailing list.
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]
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]