R/getDefaultRegistry.R

Defines functions setDefaultRegistry getDefaultRegistry

Documented in getDefaultRegistry setDefaultRegistry

#' @title Get and Set the Default Registry
#' @description
#' \code{getDefaultRegistry} returns the registry currently set as default (or
#' stops with an exception if none is set). \code{setDefaultRegistry} sets
#' a registry as default.
#'
#' @template reg
#' @family Registry
#' @export
getDefaultRegistry = function() {
  if (is.null(batchtools$default.registry))
    stop("No default registry defined")
  batchtools$default.registry
}

#' @export
#' @rdname getDefaultRegistry
setDefaultRegistry = function(reg) {
  if (!is.null(reg))
    assertRegistry(reg)
  batchtools$default.registry = reg
}

Try the batchtools package in your browser

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

batchtools documentation built on April 20, 2023, 5:09 p.m.