Skip to content

The text is calculated via cli_text(), so all cli features can be used here, including progress variables.

Usage

cli_progress_output(text, id = NULL, .envir = parent.frame())

Arguments

text

Text to output. It is formatted via cli_text().

id

Progress bar id. The default is the current progress bar.

.envir

Environment to use for glue interpolation of text.

Value

TRUE, always.

Details

The text is passed to the progress handler(s), that may or may not be able to print it.

fun <- function() {
  cli_alert_info("Before the progress bar")
  cli_progress_bar("Calculating", total = 100)
  for (i in 1:50) {
    Sys.sleep(4/100)
    cli_progress_update()
  }
  cli_progress_output("Already half way!")
  for (i in 1:50) {
    Sys.sleep(4/100)
    cli_progress_update()
  }
  cli_alert_info("All done")
}
fun()