handler_pbmcapply {progressr} | R 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
|
substyle |
(integer) The progress-bar substyle according to
|
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 |
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)
Examples
if (requireNamespace("pbmcapply", quietly = TRUE)) {
handlers("pbmcapply")
with_progress({ y <- slow_sum(1:10) })
print(y)
}