R/utils.R

Defines functions .Deprecated last drop_na drop_null `%||%`

`%||%` <- function(e1, e2) {
  if (is.null(e1)) {
    return(e2)
  }
  e1
}

drop_null <- function(x) {
  x[!vapply(x, is.null, NA)]
}

drop_na <- function(x) {
  x[!is.na(x)]
}

last <- function(x) {
  x[[length(x)]]
}

.Deprecated <- function(...) {
  if (!getOption("ftExtra.ignore.deprecation", FALSE)) base::.Deprecated(...)
}

Try the ftExtra package in your browser

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

ftExtra documentation built on May 29, 2024, 8:58 a.m.