R/isNamespaceLoaded.R

Defines functions isNamespaceLoaded

Documented in isNamespaceLoaded

#' @title Backport of isNamespaceLoaded for R < 3.2.0
#' @rdname isNamespaceLoaded
#'
#' @description
#' See the original description in \code{base::isNamespaceLoaded}.
#'
#' @keywords internal
#' @rawNamespace if (getRversion() < "3.2.0") export(isNamespaceLoaded)
#' @examples
#' # get function from namespace instead of possibly getting
#' # implementation shipped with recent R versions:
#' bp_isNamespaceLoaded = getFromNamespace("isNamespaceLoaded", "backports")
#'
#' bp_isNamespaceLoaded("backports")
isNamespaceLoaded = function(name) {
  name %in% loadedNamespaces()
}

Try the backports package in your browser

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

backports documentation built on June 24, 2024, 5:24 p.m.