R/handler_pbcol.R
handler_pbcol.Rd
Progression Handler: Progress Reported as an ANSI Background Color in the Terminal
(numeric) The adjustment of the progress update,
where adjust = 0
positions the message to the very left, and
adjust = 1
positions the message to the very right.
(integer) Amount of padding on each side of the message, where padding is done by spaces.
(function) Functions that take "complete" and "incomplete" strings that comprise the progress bar as input and annotate them to reflect their two different parts. The default is to annotation them with two different background colors and the same foreground color using the cli package.
(numeric) A non-negative scalar on how intrusive (disruptive) the reporter to the user.
(character vector) Specifies where progression updates are rendered.
Additional arguments passed to make_progression_handler()
.
This progression handler requires the cli package.
Below are a few examples on how to use and customize this progress handler.
In all cases, we use handlers(global = TRUE)
.
handlers(handler_pbcol(adjust = 0.5))
y <- slow_sum(1:25)
handlers(handler_pbcol)
with_progress({ y <- slow_sum(1:10) })
#> M: Added value 1
#> M: Added value 2
#> M: Added value 3
#> M: Added value 4
#> M: Added value 5
#> M: Added value 6
#> M: Added value 7
#> M: Added value 8
#> M: Added value 9
#> M: Added value 10
print(y)
#> [1] 55