Attaches a package to the search path (if not already attached), executes code and eventually removes the package from the search path again, restoring the previous state.
Note that this function is deprecated in favor of the (now fixed) version in withr.
Arguments
- package
(
character(1)
)
Name of the package to attach.- code
(
expression
)
Code to run.- ...
(
any
)
Additional arguments passed tolibrary()
.
See also
withr package.