withNimbleOptions: Temporarily set some NIMBLE options.

View source: R/options.R

withNimbleOptionsR Documentation

Temporarily set some NIMBLE options.

Description

Temporarily set some NIMBLE options.

Usage

withNimbleOptions(options, expr)

Arguments

options

a list of options suitable for nimbleOptions.

expr

an expression or statement to evaluate.

Value

expr as evaluated with given options.

Examples

## Not run: 
if (!(getNimbleOption('showCompilerOutput') == FALSE)) stop()
nf <- nimbleFunction(run = function(){ return(0); returnType(double()) })
cnf <- withNimbleOptions(list(showCompilerOutput = TRUE), {
    if (!(getNimbleOption('showCompilerOutput') == TRUE)) stop()
    compileNimble(nf)
})
if (!(getNimbleOption('showCompilerOutput') == FALSE)) stop()

## End(Not run)

nimble documentation built on Sept. 11, 2024, 7:10 p.m.