R/check.R

Defines functions check

Documented in check

#' Check that all dependencies are installed
#'
#' @return `TRUE` if all dependencies are installed, `FALSE` otherwise, invisibly
#' @export
#' @examples \dontrun{
#'
#' jetpack::check()
#' }
check <- function() {
  sandbox({
    status <- getStatus()
    missing <- getMissing(status)
    if (length(missing) > 0) {
      message(paste("Missing packages:", paste(missing, collapse=", ")))
      if (isCLI()) {
        warn("Run 'jetpack install' to install them")
      } else {
        warn("Run 'jetpack::install()' to install them")
      }
      invisible(FALSE)
    } else {
      success("All dependencies are satisfied")
      invisible(TRUE)
    }
  })
}

Try the jetpack package in your browser

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

jetpack documentation built on Oct. 31, 2022, 5:07 p.m.