Learn R Programming

polished (version 0.8.1)

get_package_deps: Create a list of R Package Dependencies

Description

Given a path to a directory this function will scan all .R and .Rmd files for any used R Packages along with their CRAN versions or GitHub references.

Usage

get_package_deps(app_dir = ".", all_deps = FALSE)

Value

a list of package dependencies with installation details

Arguments

app_dir

path to a directory containing R scripts or R Markdown files. Defaults to current working directory.

all_deps

boolean - whether or not to explicitly identify all "Imports" package dependencies of the packages used by your app.

Details

Currently, packages are detected via automagic::parse_packages() which supports the following calls within the code: library(), require(), and prefixed :: calls to functions.

Once an initial vector of package is created, each package is a checked that it can be downloaded and installed from CRAN or GitHub.

See Also

automagic::parse_packages()