progress_progressr {progressr} | R Documentation |
Use Progressr with Plyr Map-Reduce Functions
Description
A "progress bar" for plyr's .progress
argument.
Usage
progress_progressr(...)
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
if (requireNamespace("plyr", quietly=TRUE)) {
with_progress({
y <- plyr::llply(1:10, function(x) {
Sys.sleep(0.1)
sqrt(x)
}, .progress = "progressr")
})
}
[Package progressr version 0.14.0 Index]