Iterator function with echolocatoR-themed progress bar.
Usage
batapply(
X,
FUN = function(l) Sys.sleep(5/100),
apply_func = lapply,
total = length(X),
name = NULL,
.envir = parent.frame(),
cli.progress_show_after = 0,
clear = FALSE,
color1 = cli::col_br_cyan,
color2 = cli::col_br_magenta,
...
)Arguments
- X
a vector (atomic or list) or an
expressionobject. Other objects (including classed objects) will be coerced bybase::as.list.- FUN
the function to be applied to each element of
X: see ‘Details’. In the case of functions like+,%*%, the function name must be backquoted or quoted.- apply_func
Iterator function to use (default: lapply).
- total
Passed to
cli_progress_bar().- name
Name of the progress bar, a label, passed to
cli_progress_bar().- .envir
Passed to
cli_progress_bar().- cli.progress_show_after
How long to wait before showing the progress bar.
- clear
Whether to remove the progress bar from the screen after it has terminated. Defaults to the
cli.progress_clearoption, orTRUEif unset.- color1
First color to use in the palette.
- color2
Second color to use in the palette.
- ...
Additional arguments passed to
apply_func.
Examples
out <- batapply(X = seq_len(30))
#> ⠙ [ 0%] 🧬 ))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))>))…
#> ⠹ [100%] 🧬 🦇
#>