pkrt_list: Cite a collection of R packages

View source: R/pkrt-list.R

pkrt_listR Documentation

Cite a collection of R packages

Description

Creates a list of package citations that can be converted into a character string or data frame. This function is normally used within an R Markdown or Quarto document, where pkrt_list() automatically references the cited packages in the first (by default) .bib file specified in the YAML header if no reference for the packages already exists.

Usage

pkrt_list(...)

Arguments

...

Character vectors, separated by commas, of packages to cite.

Details

This function automatically discards duplicate and base packages. You can use pkrt_list() in combination with renv::dependencies() to cite all the packages used in a project or directory.

Value

A list of package citations with S3 class pkrt_list.

Examples

# Create a list of citations
citations <- pkrt_list("pakret", "readr", "knitr")

# You can then turn the citations into a character string
# Note that this is done automatically in inline chunks
paste(citations, collapse = ", ")

# Or a data frame
as.data.frame(citations)

pakret documentation built on April 15, 2026, 5:06 p.m.