Learn R Programming

progressr (version 0.6.0)

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

Run this code
# NOT RUN {
if (requireNamespace("pbmcapply", quietly = TRUE)) {

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

Run the code above in your browser using DataLab