R/coalesce.R

Defines functions coalesce

Documented in coalesce

coalesce <- function(...) {
    Reduce(
        function(x1,x2) {
            ifelse(is.na(x1),x2,x1)
        }, list(...)
    )
}

Try the preputils package in your browser

Any scripts or data that you put into this service are public.

preputils documentation built on July 1, 2020, 5:35 p.m.