Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 = ".", verbose = TRUE)

Arguments

app_dir

path to a directory containing R scripts or RMarkdown files. Defaults to current working directory if left blank.

verbose

logical - defaults to TRUE. Will provide feedback to detected or invalid R packages.

Details

Currently, detections are made 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 detections is built, it is further processed by validating that each detection is indeed a valid CRAN or public GitHub package and can be installed.

Value

a list of package dependencies

See Also

Examples

library(polished)
dir <- system.file("examples", "polished_example_01", package = "polished")
pkg_deps <- polished:::get_package_deps(dir)

polished

Authentication, User Administration, and Hosting for 'shiny' Apps

v0.3.0
MIT + file LICENSE
Authors
Andy Merlino [aut, cre], Patrick Howard [aut], Jimmy Briggs [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.