Description Usage Arguments Value Examples
Return a default value if a variable is null
1 | a %||% b
|
a |
The possibly null value |
b |
The default value to return if 'a' is null |
'a' if 'a' is non-null, 'b' if 'a' is null
1 2 3 | x <- list(a = 1)
y <- x$b %||% 2 # y = 2
z <- x$a %||% 10 # z = 1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.