coalesce: Returns first non-missing, non-null argument.

View source: R/coalesce.R

coalesceR Documentation

Returns first non-missing, non-null argument.

Description

Returns first non-missing, non-null argument, otherwise NULL.

We have to perform some pretty weird tryCatch stuff internally, so you should better not pass complex function calls into the arguments that can throw exceptions, as these will be completely muffled, and return NULL in the end.

Usage

coalesce(...)

Arguments

...

[any]
Arguments.

Value

[any].

Examples

f = function(x,y) {
  print(coalesce(NULL, x, y))
}
f(y = 3)

BBmisc documentation built on Sept. 29, 2022, 5:12 p.m.

Related to coalesce in BBmisc...