coalesce: Replace NA values

Description Usage Arguments Value

View source: R/coalesce.R

Description

Returns the first non-NA argument, similar to the SQL function coalesce. If a vector or matrix is passed as first argument, the remaining arguments are recycled to generate a vector/matrix of the same dimension, and coalescing is done element by element. Taken from krlmlr's misc package, referenced at StackOverflow.

Usage

1

Arguments

x

The first value to coalesce.

...

Other values to coalesce.

Value

A vector of the same length as x.


crazybilly/muadc documentation built on March 6, 2021, 4:15 p.m.