Skip to contents

Runs some R code with no modules loaded except for those that you provide, without affecting your current modules.

Usage

with_only_modules(new, code)

Arguments

new

A character vector of modules to load when executing code

code

Any R code to execute

Value

The result of evaluating code

Examples

system2("python3", "--version") |> with_only_modules("python", code=_)
#>  Successfully purged modules
#>  Successfully loaded python
#>  Successfully purged modules
#>  Successfully loaded hdf5/1.12.2