R/utils.R

Defines functions `%||%` null_or_any_na drop_last

`%||%` <- function(l, r) {
  if (is.null(l)) r else l
}

null_or_any_na <- function(x) {
  is.null(x) || any(is.na(x))
}

#' @importFrom utils head

drop_last <- function(x) {
  head(x, length(x) - 1)
}
MangoTheCat/sankey documentation built on May 7, 2019, 2:12 p.m.