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
    )
  }
}
gforge/Gmisc documentation built on Aug. 30, 2023, 7:38 a.m.