R/sefeLoadPkg.R

Defines functions safeLoadPkg

# You need the suggested package for this function
safeLoadPkg <- function(pkg) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    stop("The package ", pkg, " is needed for this function to work. Please install it.",
         call. = FALSE
    )
  }
}

Try the Gmisc package in your browser

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

Gmisc documentation built on Aug. 26, 2023, 1:07 a.m.