progress_progressr: Use Progressr with Plyr Map-Reduce Functions

Description Usage Arguments Value Limitations Examples

View source: R/plyr_progress_progressr.R

Description

A "progress bar" for plyr's .progress argument.

Usage

1

Arguments

...

Not used.

Value

A named base::list that can be passed as argument .progress to any of plyr function accepting that argument.

Limitations

One can use use doFuture::registerDoFuture() to run plyr functions in parallel, e.g. plyr::l_ply(..., .parallel = TRUE). Unfortunately, using .parallel = TRUE disables progress updates because, internally, plyr forces .progress = "none" whenever .parallel = TRUE. Thus, despite the future ecosystem and progressr would support it, it is not possible to run dplyr in parallel and get progress updates at the same time.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if (requireNamespace("plyr", quietly=TRUE)) {

  with_progress({
    y <- plyr::llply(1:10, function(x) {
      Sys.sleep(0.1)
      sqrt(x)
    }, .progress = "progressr")
  })
  
}

progressr documentation built on Sept. 24, 2021, 5:07 p.m.