handler_txtprogressbar: Progression Handler: Progress Reported as Plain Progress Bars...

Description Usage Arguments Appearance Examples

View source: R/handler_txtprogressbar.R

Description

A progression handler for utils::txtProgressBar().

Usage

1
2
3
4
5
6
7
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

1
2
3
4
handlers("txtprogressbar")

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

progressr documentation built on Sept. 24, 2021, 5:07 p.m.