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
doSort
isFALSE
.- 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 thepkgs
will be topologically sorted. IfFALSE
, then it won't. Useful if thepkgs
are 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
1
or TRUE, more outputs;2
even more. NOTE: inRequire
function, whenverbose >= 2
, also returns details as ifreturnDetails = TRUE
(for backwards compatibility).