%??% {checkmate} | R Documentation |
Coalesce operator
Description
Returns the left hand side if not missing nor NULL
, and
the right hand side otherwise.
Usage
lhs %??% rhs
Arguments
lhs |
[any] |
rhs |
[any] |
Value
Either lhs
or rhs
.
Examples
print(NULL %??% 1 %??% 2)
print(names(iris) %??% letters[seq_len(ncol(iris))])
[Package checkmate version 2.3.2 Index]