Learn R Programming

nimble (version 1.2.1)

withNimbleOptions: Temporarily set some NIMBLE options.

Description

Temporarily set some NIMBLE options.

Usage

withNimbleOptions(options, expr)

Value

expr as evaluated with given options.

Arguments

options

a list of options suitable for nimbleOptions.

expr

an expression or statement to evaluate.

Examples

Run this code
if (FALSE) {
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()
}

Run the code above in your browser using DataLab