get_libraries: Extracts the Packages Used in An Rmd File.

View source: R/utils.R

get_librariesR Documentation

Extracts the Packages Used in An Rmd File.

Description

The input filename could correspond to an R script or an Rmd file.

Usage

get_libraries(fname)

Arguments

fname

The Rmd filename or R script.

Details

The file is assumed to be either an R script or an Rmd file. If it is found to be an Rmd file using extract_chunks, it is purl-ed before libraries are extracted. If it is found to be NOT an Rmd, it is assumed to be an R script and nothing is done to process it.

The file is not parsed, so even text files will work with this function.

Value

A character vector containing the packages used within the Rmd document.


autoharp documentation built on April 3, 2025, 6:36 p.m.