R/calmr_verbosity.R

Defines functions calmr_verbosity

Documented in calmr_verbosity

#' Set verbosity options for calmr
#' @description Whether to show verbosity messages and progress bars
#' @param verbose A logical
#' @note Progress bars are handled by the progressr package.
#' This is just a convenience function.
#' @export
#' @return The list of progressr handlers (invisibly).
#' @note See package 'progressr' for further details.
calmr_verbosity <- function(verbose) {
  if (verbose) {
    progressr::handlers("progress")
    progressr::handlers(global = TRUE)
  } else {
    progressr::handlers("void")
    progressr::handlers(global = FALSE)
  }
}

Try the calmr package in your browser

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

calmr documentation built on May 29, 2024, 8:36 a.m.