Learn R Programming

papaja (version 0.1.0.9054)

cite_r: Cite R and R-packages

Description

Creates a character string to cite R and R-packages.

Usage

cite_r(file = NULL, prefix = "R-", footnote = FALSE, pkgs = "all")

Arguments

file
Character. The path and name of the .bib-file holding the references.
prefix
Character. The prefix used for all R-package reference handles.
footnote
Logical. Indicates if packages should be cited in a footnote. Ignored if no package information is available.
pkgs
Character. Vector of package names to cite. If pkgs = "all" (default) all packages in file are cited.

Value

If footnote = FALSE a character string is returned, otherwise a named list with the elements r and pkgs.

Details

If footnote = FALSE a character string citing R and R-packages including version numbers is returned. Otherwise a named list with the elements r and pkgs is returned. The former element holds a character string citing R and a reference to a footnote; the latter element contains a character string for the footnote citing R-packages. For correct rendering, the footnote string needs to be a separate paragraph in the Markdown document.

See Also

r_refs, write_bib

Examples

Run this code
cite_r()

Run the code above in your browser using DataLab