R/update_progress.R

Defines functions update_progress

Documented in update_progress

#' updating progress bars
#'
#' Takes care of updating a progress bar and stopping when appropriate
#'
#' @param .pb the progress bar object
#'
#' @export
#' @return the progress bar
update_progress <- function(.pb = NULL) {
  if ((!is.null(.pb)) && inherits(.pb, "Progress") && (.pb$i < .pb$n)) .pb$tick()$print()

  if ((!is.null(.pb)) && inherits(.pb, "Progress") && (.pb$i == .pb$n)) .pb$stop()$print()

  .pb
}

Try the knitrProgressBar package in your browser

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

knitrProgressBar documentation built on May 2, 2019, 12:21 p.m.