More about cli: Progress bars

Progress bars

clean <- function() {
  wait_for_it <- function(.envir = rlang::caller_env()) {
    for (i in 1:100) {
      Sys.sleep(3/100)
      cli::cli_progress_update(.envir = .envir)
    }
  }
  cli::cli_progress_bar("Cleaning data #1", total = 100)
  wait_for_it()
  cli::cli_progress_bar("Cleaning data #2")
  wait_for_it()
}
clean()