first_non_null: Return the first non-null argument

View source: R/first_non_null.R

first_non_nullR Documentation

Return the first non-null argument

Description

This is an old coalesce functions for its arguments. It was actually called coalesce, but now dplyr has also one of those. So let's just The first_non_null function takes any number of arguments and returns the first argument that is not null (i.e., NA). If all arguments are null, the function returns NULL.

Usage

first_non_null(...)

Arguments

...

One or more arguments of any type.

Value

The first non-null argument or NULL if all arguments are null.


edalfon/efun documentation built on June 23, 2024, 4:17 a.m.