View source: R/handler_txtprogressbar.R
handler_txtprogressbar | R Documentation |
A progression handler for utils::txtProgressBar()
.
handler_txtprogressbar(
char = "=",
style = 3L,
file = stderr(),
intrusiveness = getOption("progressr.intrusiveness.terminal", 1),
target = "terminal",
...
)
char |
(character) The symbols to form the progress bar for
|
style |
(integer) 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 |
Below are a few examples on how to use and customize this progress handler.
In all cases, we use handlers(global = TRUE)
.
handlers("txtprogressbar") y <- slow_sum(1:25)
handlers(handler_txtprogressbar(style = 1L)) y <- slow_sum(1:25)
handlers(handler_txtprogressbar(style = 3L)) y <- slow_sum(1:25)
handlers(handler_txtprogressbar(char = "#")) y <- slow_sum(1:25)
handlers(handler_txtprogressbar(char = "<>")) y <- slow_sum(1:25)
handlers(handler_txtprogressbar(char = cli::col_red(cli::symbol$heart))) y <- slow_sum(1:25)
handlers("txtprogressbar")
with_progress({ y <- slow_sum(1:10) })
print(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.