NULL
R/operators.R
op-null-default.Rd
This infix function makes it easy to replace NULLs with a default value. It's inspired by the way that Ruby's or operation (||) works.
||
x %||% y
If x is NULL, will return y; otherwise returns x.
x
y
1 %||% 2 #> [1] 1 NULL %||% 2 #> [1] 2