Description Usage Arguments Details Value See Also
View source: R/progress-along.R
Note that this function is currently experimental!
Use cli_progress_along()
in a mapping function or in a for loop, to add a
progress bar. It uses cli_progress_bar()
internally.
1 2 3 4 5 6 7 | cli_progress_along(
x,
name = NULL,
total = length(x),
...,
.envir = parent.frame()
)
|
x |
Sequence to add the progress bar to. |
name |
Name of the progtess bar, a label, passed to
|
total |
Passed to |
... |
Passed to |
.envir |
Passed to |
Usage:
lapply(cli_progress_along(X), function(i) ...)
for (i in cli_progress_along(seq)) { ... }
Note that if you use break
in the for
loop, you probably want to
terminate the progress bar explicitly when breaking out of the loop,
or right after the loop:
for (i in cli_progress_along(seq)) { ... if (cond) cli_progress_done() && break ... }
An index vector from 1 to length(x)
that triggers progress
updates as you iterate over it.
cli_progress_bar()
and the traditional progress bar API.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.