This uses pkgDepTopoSort internally so that the package
dependency tree is determined, and then packages are unloaded
in the reverse order. Some packages don't unload successfully for
a variety of reasons. Several known packages that have this problem
are identified internally and not unloaded. Currently, these are
glue, rlang, ps, ellipsis, and, processx.
Usage
detachAll(
pkgs,
dontTry = NULL,
doSort = TRUE,
verbose = getOption("Require.verbose")
)Arguments
- pkgs
A character vector of packages to detach. Will be topologically sorted unless
doSortisFALSE.- dontTry
A character vector of packages to not try. This can be used by a user if they find a package fails in attempts to unload it, e.g., "ps"
- doSort
If
TRUE(the default), then thepkgswill be topologically sorted. IfFALSE, then it won't. Useful if thepkgsare already sorted.- verbose
Numeric or logical indicating how verbose should the function be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE, then minimal outputs; if
1or TRUE, more outputs;2even more. NOTE: inRequirefunction, whenverbose >= 2, also returns details as ifreturnDetails = TRUE(for backwards compatibility).