R/utils_logic.R

Defines functions non_null if_any `%|||chr%` `%|||%` `%||%`

`%||%` <- function(x, y) {
  if (length(x) > 0L) {
    x
  } else {
    y
  }
}

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

`%|||chr%` <- function(x, y) {
  if (identical(unname(x), "")) {
    y
  } else {
    x
  }
}

if_any <- function(condition, true, false) {
  if (any(condition)) {
    true
  } else {
    false
  }
}

non_null <- function(x) {
  Filter(f = function(x) !is.null(x), x = x)
}

Try the crew.aws.batch package in your browser

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

crew.aws.batch documentation built on June 9, 2025, 5:09 p.m.