R/zzz.R

Defines functions assert cl

cl <- function(x) Filter(Negate(is.null), x)
assert <- function(x, y) {
  if (!is.null(x)) {
    if (!inherits(x, y)) {
      stop(deparse(substitute(x)), " must be of class ",
           paste0(y, collapse = ", "), call. = FALSE)
    }
  }
}
ropensci/taxview documentation built on Sept. 13, 2022, 8:41 p.m.