Learn R Programming

progressr (version 0.15.1)

progress_progressr: Use Progressr with Plyr Map-Reduce Functions

Description

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

Usage

progress_progressr(...)

Value

A named base::list that can be passed as argument .progress

to any of plyr function accepting that argument.

Arguments

...

Not used.

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

Run this code
if (requireNamespace("plyr", quietly=TRUE)) {

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

Run the code above in your browser using DataLab