Skip to contents

This function loads a list of R packages, writes their citations to a BibTeX file, and returns a data frame of package versions.

Usage

load_libraries(library_list)

Arguments

library.list

A character vector of package names to load.

Value

A data frame with package names and versions (including base R).

Details

  • Loads each package in library_list using library().

  • Writes BibTeX citations for each package (and base R) to bibliography.bib in the working directory.

  • Returns a data frame with package names and versions, including base R.

Examples

load_libraries(c("stats", "utils"))
#>   Package                              Version
#> 1       R R version 4.5.1 (2025-06-13) [@base]
#> 2   stats                       4.5.1 [@stats]
#> 3   utils                       4.5.1 [@utils]