Description Usage Arguments Details Value Note Author(s) See Also Examples
Get package dependencies
1 2 3 4 5 6 |
pkgs |
character vector of package names |
dependencies |
character vector of dependency types to include.
Choices are "Depends", "Imports", "LinkingTo", "Suggests",
and "Enhances". Defaults to |
installed |
Logical indicating whether to pull dependency information from installed packages. Defaults to TRUE. |
available |
Logical indicating whether to pull dependency information from available packages. Defaults to TRUE. |
base |
Logical indicating whether to include dependencies on base packages that are included in the R installation. Defaults to FALSE. |
recommended |
Logical indicating whether to include dependencies on recommended packages that are included in the R installation. Defaults to FALSE. |
This function recursively constructs the list of dependencies for the
packages given by pkgs
. By default, the dependency information
is extracted from both installed and available packages. As a
consequence, it works both for local and CRAN packages.
A character vector of package names.
If available=TRUE
R will attempt to access the currently
selected CRAN repository, prompting for one if necessary.
Gregory R. Warnes emailgreg@warnes.net based on the non exported
utils:::getDependencies
and
utils:::.clean_up_dependencies2
.
installed.packages
,
available.packages
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## A locally installed package
getDependencies("MASS", installed=TRUE, available=FALSE)
## Not run:
## A package on CRAN
getDependencies("gregmisc", installed=FALSE, available=TRUE)
## End(Not run)
## Show base and recommended dependencies
getDependencies("MASS", available=FALSE, base=TRUE, recommended=TRUE)
## Not run:
## Download the set of packages necessary to support a local package
deps <- getDependencies("MyLocalPackage", available=FALSE)
download.packages(deps, destdir="./R_Packages")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.