- output
Either
"file" to generate a separate document with formatted citations
for all packages;
"paragraph" to return a paragraph with in-text citations of used packages,
suitable to be used within an 'R Markdown' or 'Quarto' document;
"table" to return a table with package name, version, and citations, to be used
in 'R Markdown' or 'Quarto';
"citekeys" to return a vector with citation keys.
In all cases, a BibTeX file with package references is saved on disk
(see bib.file).
- out.dir
Directory to save the output document and a BibTeX file with
the references. It is recommended to set out.dir = getwd().
- out.format
Output format when output = "file":
either "html" (the default), "docx" (Word), "pdf",
"tex-fragment" (LaTeX fragment to be inserted into another LaTeX document),
"tex-document" (full LaTeX document), "Rmd", or "md" (markdown).
(Note that choosing "pdf" requires a working installation of LaTeX,
see https://yihui.org/tinytex/).
- citation.style
Optional. Citation style to format references for a
particular journal
(see https://pkg.yihui.org/rmarkdown-cookbook/bibliography).
If the CSL is not available in out.dir, it will be downloaded
automatically from the official
GitHub repository
using get_csl().
If using cite_packages() within an R Markdown or Quarto
document, citation.style should be NULL (the default). The citation style
should instead be defined in the YAML metadata of the document
(see https://pakillo.github.io/grateful/#using-grateful-with-rmarkdown-or-quarto).
- pkgs
Character. Either "All" to include all packages used in scripts
within the project/folder (the default), "Session" to include only packages
used in the current session, or the path to an R script (including .R extension),
'Rmarkdown' (.Rmd) or 'Quarto' document (qmd) to scan only the packages used
in that single script or document.
Alternatively, pkgs can also be a character vector of package names to
get citations for. To cite R as well as the given packages,
include "base" in pkgs (see examples).
Finally, pkgs can be a character vector of Depends, Imports, Suggests,
LinkingTo and their combination, to obtain the dependencies of an R package
as stated in its DESCRIPTION file (see desc.path).
Note that in this case, package versions will
be 'NA' unless required versions are stated in the DESCRIPTION file
(e.g. 'testthat (>= 3.0.0)'), and package citations will use the information
from installed versions of those packages in the user computer.
- omit
Character vector of package names to be omitted from the citation
report. grateful is omitted by default. Use omit = NULL to include all
packages.
- cite.tidyverse
Logical. If TRUE, all tidyverse packages
(dplyr, ggplot2, etc) will be collapsed into a single citation
of the 'tidyverse', as recommended by the tidyverse team.
- dependencies
Logical. Include the dependencies of your used packages?
If TRUE, will include all the packages that your used packages depend on.
- include.RStudio
Logical. If TRUE, adds a citation for the
current version of RStudio.
- passive.voice
Logical. If TRUE, uses passive voice in any paragraph
generated for citations.
- text.start
Optional. Text string to use to start the citation paragraph.
If NULL (the default), will use "We used" or "This work was completed using"
if passive.voice = TRUE.
Note this allows for customising the language of citation paragraphs.
- text.pkgs
Optional. Text string to use to introduce the packages used.
If NULL (the default), will use "(and) the following R packages".
- text.RStudio
Optional. Text string to use to introduce RStudio.
If NULL (the default), will use "running in".
- out.file
Desired name of the citation report to be created if
output = "file". Default is "grateful-report" (without extension).
- bib.file
Desired name for the BibTeX file containing packages references
("grateful-refs" by default).
- desc.path
Optional. Path to the package DESCRIPTION file from which to
parse the package dependencies (see pkgs).
If NULL, will default to the working directory.
- skip.missing
Logical. If FALSE (the default), will return an error if
some package(s) are used somewhere in the project but they are not currently
installed. If TRUE, will skip those missing packages, issuing a warning. Note
such packages will thus not be included in the citation list, even though they
might have been used in the project.
- ...
Other parameters passed to renv::dependencies().