Replace NULL

x %||% y

Arguments

x

A value to check

y

A value to substitute if x is null

Examples

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