deps | R Documentation |
Search R scripts for packages that are required.
deps(path = ".", base = FALSE, installed = TRUE, available = TRUE,
list = FALSE)
path |
a directory or file containing R scripts. |
base |
whether to include base packages in the output. |
installed |
whether to include installed packages in the output. |
available |
whether to include available packages in the output. |
list |
whether to return packages in list format, split by script. |
The files analyzed are those with the file extensions .R
, .r
,
.Rmd
, and .rmd
.
Names of packages as a vector, or in list format if list=TRUE
. If no
dependencies are found, the return value is NULL
.
Package names are matched based on four patterns:
library(*) require(*) *::object *:::object
The search algorithm may return false-positive dependencies if these patterns occur inside if-clauses, strings, comments, etc.
installed.packages
, available.packages
.
TAF-package
gives an overview of the package.
## Not run:
dir <- system.file(package="MASS", "scripts")
script <- system.file(package="MASS", "scripts/ch08.R")
deps(script) # dependencies
deps(script, base=TRUE) # including base packages
deps(script, installed=FALSE) # not (yet) installed
deps(dir)
deps(dir, list=TRUE)
deps(dir, available=FALSE) # dependencies that might be unavailable
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.