progressing: progressing tag to use progress bar with functionals

Description Usage Arguments Examples

Description

progressing tag to use progress bar with functionals

Usage

1
2
3
4
5
progressing(.format = "[:bar] :percent", .width = options("width")[[1]]
  - 2, .complete = "=", .incomplete = "-", .current = ">",
  .callback = invisible, .clear = TRUE, .show_after = 0.2,
  .force = FALSE, .message = NULL, .tokens = alist(),
  .FUN_arg = NULL)

Arguments

.format

The format of the progress bar. see ?progress::progress_bar

.width

Width of the progress bar.

.complete

Completion character.

.incomplete

Incomplete character.

.current

Current character.

.callback

Callback function to call when the progress bar finishes. The progress bar object itself is passed to it as the single parameter.

.clear

Whether to clear the progress bar on completion.

.show_after

Amount of time in seconds, after which the progress bar is shown on the screen. For very short processes, it is probably not worth showing it at all.

.force

Whether to force showing the progress bar, even if the given (or default) stream does not seem to support it.

.message

A message to display on top of the bar

.tokens

A list of unevaluated expressions, using alist, to be passed passed to the tick method of the progress bar

.FUN_arg

name or position of function arg, by default looks for the first argument that is either FUN, .f or f

Examples

1
2
3
4
5
6
7
## Not run: 
library(purrr)
progressing$map(1:3, ~{Sys.sleep(1);.x*2})

## End(Not run)
x <- progressing$lapply(1:10000, force)
progressing(.format = "[:bar] :eta")$lapply(1:5, function(x) {Sys.sleep(1);x*2})

moodymudskipper/tags documentation built on June 25, 2019, 10:54 a.m.