R/util.R

Defines functions coalesce

Documented in coalesce

#' return first argument that is not null
#'
#' @export
coalesce <- function(a,b,...) {
  if (!is.null(a)){
    return(a)
  }
  if (missing(b)){
    return (NULL)
  }
  coalesce(b,...)
}
schardtbc/alpacaR documentation built on March 12, 2020, 6:18 a.m.