Learn R Programming

knitcitations (version 0.1-0)

write.bibtex: write a bibtex file

Description

write a bibtex file

Usage

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

Arguments

entry
a 'bibentry' object, list of bibentry objects, or a character vector of package names
file
output bibtex file. Will automatically append '.bib' if not added. if 'NULL' will use stdout.
append
a logical indicating that bibtex entries be added the the file. If FALSE (default), the file is overwritten.
verbose
a logical to toggle verbosity. If 'file=NULL', verbosity is forced off.

Value

  • a list of citation information, invisibly

Details

This function is simply a wrapper to the function write.bib by Renaud Gaujoux. Though that function has been added to the 'bibtex' package by Romain Francois (a more sensible place to find it), that version was not avialble on CRAN at the time of writing.

The 'knitcitations' package automatically extends the use of this function to be able to write bibtex files from a string of DOIs, making it valuable for purposes beyond the citation of packages.

See Also

read.bib citep citet

Examples

Run this code
write.bibtex(c('bibtex', 'knitr', 'knitcitations'), file="example.bib")
 refs <- lapply(c("10.1111/j.1461-0248.2005.00827.x","10.1890/11-0011.1"), ref)
 write.bibtex(refs, file="refs.bib")

Run the code above in your browser using DataLab