R/utils-helpers.R
or-operator.Rd
Infix operator for NULL default
a %||% b
The value to check.
The default value if `a` is `NULL`.
`a` if not `NULL`, otherwise `b`.
.
x <- NULL y <- 5 x %||% y # Returns 5 #> [1] 5 z <- 10 z %||% y # Returns 10 #> [1] 10