Description Usage Arguments Value Author(s) Examples
Allow a function to be called with a progress bar
1 |
.f |
Function to be called. Pre-processed with
|
.pb |
Progress bar object. Both |
... |
Arguments to function |
Function .f
modified to tick the progress bar
Alexey Shiklomanov
1 2 3 4 5 6 7 8 9 10 | # The progress package has nice
f <- function(x) Sys.sleep(1)
pb <- progress::progress_bar$new(total = 5)
invisible(lapply(1:5, with_pb(f, pb)))
# Base R's txtProgressBar is also supported, but note that it does
# not close itself
pb <- txtProgressBar(max = 5, style = 3)
invisible(lapply(1:5, with_pb(~Sys.sleep(0.5), pb)))
close(pb)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.