write.bib(entry = NULL, file = "Rpackages.bib", prefix = "", append = FALSE, verbose = TRUE)
bibentry
object or a
character vector of package names. If NULL
, then
the list of all installed packages is used.stdout
, or a link{connection}
object. If
file
is a character string, an extension '.bib' is
appended if not already present.FALSE
(default), the file is overwritten.file=NULL
, verbosity is forced off.the list of Bibtex objects -- invisibly.
Generates a Bibtex file from a list of packages or all the installed packages. It is useful for adding relevant citations in Sweave documents.
Multiple citations are handled by adding a numeric suffix
to the Bibtex key (other than the first/main citation) as
"
(e.g. pkg, pkg2, pkg3).
This function has now been integrated by Romain François in the bibtex package.
[R] Creating bibtex file of all installed packages? Achim Zeileis. R-help mailing list. https://stat.ethz.ch/pipermail/r-help/2009-December/222201.html
#library(bibtex)pkgmaker::write.bib(c('bibtex', 'utils', 'tools'), file='references')Converted 3 of 3 package citations to BibTeX Writing 3 Bibtex entries ... OK Results written to file 'references.bib'bibs <- bibtex::read.bib('references.bib')pkgmaker::write.bib(bibs, 'references2.bib')Writing 3 Bibtex entries ... OK Results written to file 'references2.bib'md5 <- tools::md5sum(c('references.bib', 'references2.bib'))md5[1] == md5[2]references.bib TRUE# write to stdout()pkgmaker::write.bib(c('bibtex', 'utils', 'tools'), file=NULL)@Manual{bibtex, title = {bibtex: bibtex parser}, author = {Romain Francois}, year = {2013}, note = {R package version 0.3-5}, url = {http://CRAN.R-project.org/package=bibtex}, } @Manual{utils, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2013}, url = {http://www.R-project.org/}, } @Manual{tools, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2013}, url = {http://www.R-project.org/}, }
link{connection}
, link{bibentry}
Rpackages.bib
from Achim Zeileis (see
References).