pkrt_list {pakret}R Documentation

Cite a collection of R packages

Description

Creates a list of package citations that can be turned into a character string or data frame. This function should normally only be used in an R Markdown or Quarto document, in which case pkrt_list() automatically references the cited packages in the first (by default) .bib file specified in the YAML header if no references of the packages already exist.

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", "withr")

# You can then turn the citations into a character string
paste(citations, collapse = ", ")

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

[Package pakret version 0.2.2 Index]