with_package: Execture code with a modified search path

View source: R/with_package.R

with_packageR Documentation

Execture code with a modified search path

Description

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.

Usage

with_package(package, code, ...)

Arguments

package

(character(1))
Name of the package to attach.

code

(expression)
Code to run.

...

(any)
Additional arguments passed to library().

Value

Result of the evaluation of code.

See Also

withr package.


mlr-org/mlr3misc documentation built on April 28, 2024, 11 p.m.