cite_r: Cite R and R Packages

View source: R/cite_r.R

cite_rR Documentation

Cite R and R Packages

Description

Creates character strings to cite R and R packages.

Usage

cite_r(
  file = NULL,
  prefix = "R-",
  footnote = FALSE,
  pkgs = NULL,
  omit = TRUE,
  lang = NULL,
  ...
)

Arguments

file

Character. Path and name of the .bib-file holding the references. If NULL, only R is cited.

prefix

Character. 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 or omit depending on omit.

omit

Logical. If TRUE, pkgs constitutes a list of packages not to cite (a blacklist). If FALSE, pkgs constitutes a list of packages to cite (a whitelist).

lang

Character. Language code according to BCP 47. If NULL, the defaults to the language set in the YAML front matter or to English.

...

Additional arguments, which are currently ignored.

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 that creates the footnote. For correct rendering, the footnote string needs to be a separate paragraph in the R Markdown document.

Value

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

See Also

r_refs(), knitr::write_bib()

Examples

cite_r()

papaja documentation built on Oct. 30, 2024, 9:09 a.m.