R/utils.R
null_default.Rd
This infix operator provides a convenient way to handle NULL values by providing a default value.
NULL
a %||% b
An object to check for NULL.
The default value to return if a is NULL.
a
a if it is not NULL, otherwise b.
b
"value" %||% "default" #> [1] "value" NULL %||% "default" #> [1] "default"