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

Description Usage Arguments Requirements Appearance Examples

View source: R/handler_pbmcapply.R

Description

A progression handler for pbmcapply::progressBar().

Usage

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

1
2
3
4
5
6
7
if (requireNamespace("pbmcapply", quietly = TRUE)) {

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

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