coalesce: Coalesce operator

Description Usage Arguments Value Examples

Description

Returns the left hand side if not missing nor NULL, and the right hand side otherwise.

Usage

1
lhs %??% rhs

Arguments

lhs

[any]
Left hand side of the operator. Is returned if not missing or NULL.

rhs

[any]
Right hand side of the operator. Is returned if lhs is missing or NULL.

Value

Either lhs or rhs.

Examples

1
2
print(NULL %??% 1 %??% 2)
print(names(iris) %??% letters[seq_len(ncol(iris))])

checkmate documentation built on May 19, 2017, 1:16 p.m.

Search within the checkmate package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.