ic-single-use {icecream} | R Documentation |
Temporarily enable or disable ic()
Description
These functions let you evaluate an expression with either ic()
enabled or disabled without
affecting if ic()
is enabled globally.
Usage
with_ic_enable(expr)
with_ic_disable(expr)
Arguments
expr |
An expression containing the |
Value
Returns the result of evaluating the expression.
Functions
-
with_ic_enable()
: evaluates the expression withic()
enabled. -
with_ic_disable()
: evaluates the expression withic()
disabled.
Examples
ic_enable()
fun <- function(x) {
ic(x * 100)
}
fun(2)
with_ic_disable(fun(2))
fun(4)
ic_disable()
fun(1)
with_ic_enable(fun(1))
[Package icecream version 0.2.2 Index]