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

handler_pbmcapply

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


Description

A progression handler for pbmcapply::progressBar().

Usage

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

Arguments

substyle

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

style

(character) The progress-bar style according to pbmcapply::progressBar().

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

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. Below is how this progress handler renders by default at 0%, 30% and 99% progress:

With handlers(handler_pbmcapply()):

 |                                         |   0%, ETA NA
 |===========                           |  30%, ETA 01:32
 |======================================|  99%, ETA 00:01

Examples

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

  handlers("pbmcapply")
  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.