Description Usage Arguments Value Examples
Evaluates expressions until one that is not NULL
is encountered
and returns that. Expressions after the first non-NULL
result are not
evaluated. If all expressions are NULL
, it will return NULL
1 |
... |
expressions to try to evaluate |
The result of evaluating one of the expressions. Will only be
NULL
if they all evaluated to NULL
1 2 3 4 5 6 7 8 9 10 11 12 | f <- function() {
cat("Evaluating f\n")
NULL
}
g <- function() {
cat("Evaluating g\n")
2
}
null_switch(NULL, f(), g())
null_switch(NULL, g(), f())
null_switch(f(), f(), f())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.