R: Return the first argument passed (out of any number) that is...
NVL
R Documentation
Return the first argument passed (out of any number) that is not NULL.
Description
This function is inspired by SQL function NVL, and simply returns
the first argument that is not NULL, or NULL if all arguments are NULL.
Usage
NVL(...)
Arguments
...
Expressions to be tested.
Details
Note that an earlier version of this function took only two arguments:
EXPR, that was tested and returned if not NULL and
NULLV, which was returned if EXPR was
NULL. The new version produces identical output for the same
(two-argument) input, but tests any number of expressions
sequentially.
Value
The first argument that is not NULL, or NULL if all
are.