Returns x if it is not NULL, otherwise returns y.
Equivalent to rlang::%||% but without requiring that dependency.
Examples
NULL %||% "default"
#> [1] "default"
"value" %||% "default"
#> [1] "value"
list()$missing %||% 0
#> [1] 0
Returns x if it is not NULL, otherwise returns y.
Equivalent to rlang::%||% but without requiring that dependency.
NULL %||% "default"
#> [1] "default"
"value" %||% "default"
#> [1] "value"
list()$missing %||% 0
#> [1] 0