These functions let you evaluate an expression with either ic()
enabled or disabled without
affecting if ic()
is enabled globally.
with_ic_enable(expr) with_ic_disable(expr)
expr | An expression containing the |
---|
Returns the result of evaluating the expression.
with_ic_enable
: evaluates the expression with ic()
enabled.
with_ic_disable
: evaluates the expression with ic()
disabled.
#>with_ic_disable(fun(2))#> [1] 200fun(4)#>#> [1] 100with_ic_enable(fun(1))#>