Find Packages Required for Code to Run
Figure out what packages are required to run a given R expression,
file ('.R', '.Rmd', '.Rnw', ...), or a directory of files. Includes
heuristics for common implicit dependencies.
requirements allows you to impute required packages from R code, files (like
.Rnw) and directories. It primarily looks for use of functions like
::, but also uses heuristics to detect common implicit dependencies (e.g. methods, shiny, and roxygen2).
The inspiration for this code comes from packrat. We're extracting it out in to a separate package so that it can be more easily extended and used by others.
requirements is not currently available on CRAN, but you can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("hadley/requirements")
Functions in requirements
|requirements-package||requirements: Find Packages Required for Code to Run|
|req_code||Extract requirements from code|
|req_file||Extract requirements from a file|
|req_dir||Extract requirements from a directory|
Include our badge in your README