withNimbleOptions: Temporarily set some NIMBLE options.

Description Usage Arguments Value Examples

View source: R/options.R

Description

Temporarily set some NIMBLE options.

Usage

1

Arguments

options

a list of options suitable for nimbleOptions.

expr

an expression or statement to evaluate.

Value

expr as evaluated with given options.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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 May 23, 2021, 5:07 p.m.