Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

handlers("txtprogressbar")

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

progressr

An Inclusive, Unifying API for Progress Updates

v0.10.0
GPL (>= 3)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.