set-if-null | R Documentation |
Set a default value if an object is null
lhs %||% rhs
lhs |
An object to set if it's null |
rhs |
The value to provide if x is null |
rhs if lhs is null, else lhs
Hadley Wickham
https://adv-r.hadley.nz/functions.html#missing-arguments
## Not run:
4 %||% 5
NULL %|| 5
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.