R/backports.R

Defines functions tryInvokeRestart isFALSE isTRUE

isTRUE <- function(x) {
  is.logical(x) && length(x) == 1L && !is.na(x) && x
}

isFALSE <- function(x) {
  is.logical(x) && length(x) == 1L && !is.na(x) && !x
}

tryInvokeRestart <- function(r, ...) {
  if (!isRestart(r)) {
    r <- findRestart(r)
  }
  if (is.null(r)) {
    invisible(NULL)
  } else {
    invokeRestart(r, ...)
  }
}

Try the bettermc package in your browser

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

bettermc documentation built on April 14, 2023, 12:31 a.m.