load.depends {reposTools} | R Documentation |
Given a package or a vignette, will determine any dependencies and load the required packages - as well as alerting the user to any unresolved problems.
load.depends(x,suggests=TRUE,uses=TRUE,Rversion=TRUE) unresolved.depends(x,suggests=TRUE,uses=TRUE,Rversion=TRUE)
x |
The object to check |
suggests |
Whether or not to fail if suggests level
dependencies are not met |
uses |
Whether or not to fail if uses level dependencies
are not met |
Rversion |
Whether or not to fail if any R version dependencies are not met |
load.depends: The function will first determine if the object is an installed package or a vignette. In either case, it will extract a listing of all dependencies (both the names and any versioning requirements). If R is listed as a dependency, this is first checked (as well as any versioning: e.g. 'R (>=1.6.0)'). Then, any packages listed as dependencies are loaded. If a package is not able to be loaded, the function will halt and print out an appropriate error message.
unresolved.depends: This function behaves almost identically to load.depends except that instead of loading any depended packages, it will return a list with any unresolved dependencies.
There are several levels of dependencies available:
depends
: The package/vignette directly depends on the specified
package for general uses.
suggests
: The package/vignette uses the specified package, but
only in tangential ways. A user will generally be able to achieve
normal functionality without it.
uses
: The package/vignette is only using the specified
package for examples, etc.
If unresolved.depends
is used, a list is returned representing
any unresolved dependencies. The list structure is such that each
element corresponds to one level of dependency (i.e. x$Depends
,
x$Suggests
, x$Uses
) and contains a string detailing
this information.
Jeff Gentry
load.depends("Biobase")