R/safeLoadPackage.R

Defines functions safeLoadPackage

Documented in safeLoadPackage

#' Safely loads package
#'
#' Stops if the package doesn't exist
#' @inheritParams base::requireNamespace
safeLoadPackage <- function(package) {
  if (!requireNamespace(package, quietly = TRUE)) {
    stop("The package ", package, " is needed for this function to work. Please install it.",
      call. = FALSE
    )
  }
}

Try the forestplot package in your browser

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

forestplot documentation built on Oct. 11, 2024, 5:07 p.m.