Replace NULL

x %||% y

Arguments

x

A value to check

y

A value to substitute if x is null

Examples

if (FALSE) { # \dontrun{
x <- NULL
x <- x %||% "none"
x <- x %||% NA
} # }