Learn R Programming

progressr (version 0.6.0)

handler_txtprogressbar: Progression Handler: Progress Reported as Plain Progress Bars (Text) in the Terminal

Description

A progression handler for utils::txtProgressBar().

Usage

handler_txtprogressbar(
  style = 3L,
  file = stderr(),
  intrusiveness = getOption("progressr.intrusiveness.terminal", 1),
  target = "terminal",
  ...
)

Arguments

style

(integer) The progress-bar style according to utils::txtProgressBar().

file

(connection) A base::connection to where output should be sent.

intrusiveness

(numeric) A non-negative scalar on how intrusive (disruptive) the reporter to the user.

target

(character vector) Specifies where progression updates are rendered.

Additional arguments passed to make_progression_handler().

Appearance

Below is how this progress handler renders at 0%, 30% and 99% progress for the three different style values that utils::txtProgressBar() supports.

With handlers(handler_txtprogressbar(style = 1L)):

====================================
==========================================================

With handlers(handler_txtprogressbar(style = 2L)):

====================================
==========================================================

With handlers(handler_txtprogressbar(style = 3L)):

  |                                                 |   0%
  |===============                                  |  30%
  |=================================================|  99%

Examples

Run this code
# NOT RUN {
handlers("txtprogressbar")

with_progress({ y <- slow_sum(1:10) })
print(y)
# }

Run the code above in your browser using DataLab