R/assert.R

Defines functions assert

assert <- function(condition,
                   message = NULL) {
  if(is.na(condition)) {
    stop("Condition is NA", call. = FALSE)
  }
  if(!condition) {
    if(is.null(message)) {
      stop(FALSE, call. = FALSE)
    } else {
      stop(message, call. = FALSE)
    }
  }
}

Try the skillsengineeR package in your browser

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

skillsengineeR documentation built on March 4, 2021, 5:07 p.m.