handler_pbmcapply: Progression Handler: Progress Reported via 'pbmcapply'...

View source: R/handler_pbmcapply.R

handler_pbmcapplyR Documentation

Progression Handler: Progress Reported via 'pbmcapply' Progress Bars (Text) in the Terminal

Description

A progression handler for pbmcapply::progressBar().

Usage

handler_pbmcapply(
  char = "=",
  substyle = 3L,
  style = "ETA",
  file = stderr(),
  intrusiveness = getOption("progressr.intrusiveness.terminal", 1),
  target = "terminal",
  ...
)

Arguments

char

(character) The symbols to form the progress bar for utils::txtProgressBar().

substyle

(integer) The progress-bar substyle according to pbmcapply::progressBar().

style

(character) The progress-bar style according to

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().

Requirements

This progression handler requires the pbmcapply package.

Appearance

Below are a few examples on how to use and customize this progress handler. In all cases, we use handlers(global = TRUE). Since style = "txt" corresponds to using handler_txtprogressbar() with style = substyle, the main usage of this handler is with style = "ETA" (default) for which substyle is ignored.

handlers("pbmcapply")
y <- slow_sum(1:25)

handler_pbmcapply-default.svg

Examples

if (requireNamespace("pbmcapply", quietly = TRUE)) {

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

progressr documentation built on Aug. 11, 2023, 1:07 a.m.