pkg_unload: unloads a package, unloading its dependent packages if needed
Description
To be able to unload properly a package, all the packages that depend
even indirectly on it should be unloaded first.
Usage
pkg_unload(
pkg_or_name,
src_pkgs = get_srcpkgs(),
dry_run = FALSE,
loaded = loadedNamespaces(),
quiet = FALSE
)
Value
a data frame of the unloaded package names, and whether they were
attached, invisibly or NULL if the package is not loaded
Arguments
- pkg_or_name
a package name or object ("package" or "srcpkg")
- src_pkgs
a collection of source packages as a srckgs object.
- dry_run
whether not to actually execute any action having side-effects
- loaded
the loaded packages, useful for testing.
- quiet
whether to be quiet/silent
Details
N.B: this function also works for non source packages.
Examples
Run this codepkg <- setup_and_get_dummy_srcpkg()
pkg_load(pkg)
pkg_unload(pkg)
Run the code above in your browser using DataLab