R/zzz.R

Defines functions assert subs pluck

pluck <- function(input, x) vapply(input, "[[", numeric(1), x)

subs <- function(z, start, stop) substring(z, start, stop)

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/isdparser documentation built on Sept. 12, 2022, 8:01 a.m.