| Title: | Progress Reporting of Common Functions via One Magic Function |
|---|---|
| Description: | The progressify() function rewrites (transpiles) calls to sequential and parallel map-reduce functions such as base::lapply(), purrr::map(), foreach::foreach(), and plyr::llply() to signal progress updates. By combining this function with R's native pipe operator, you have a straightforward way to report progress on iterative computations with minimal refactoring, e.g. 'lapply(x, fcn) |> progressify()' and 'purrr::map(x, fcn) |> progressify()'. It is compatible with the parallel-processing map-reduce packages 'future.apply', 'furrr', 'crossmap', 'foreach', 'doFuture', and 'futurize'. It also supports domain-specific packages including 'boot', 'fwb', 'lme4', 'partykit', 'sandwich', and 'SimDesign', e.g. 'boot::boot(data, stat, R) |> progressify()'. |
| Authors: | Henrik Bengtsson [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-7579-5165>) |
| Maintainer: | Henrik Bengtsson <[email protected]> |
| License: | Apache License (>= 2) |
| Version: | 0.2.0-9005 |
| Built: | 2026-07-06 10:54:12 UTC |
| Source: | https://github.com/futureverse/progressify |
Evaluate a regular map-reduce call with progress updates
progressify( expr, substitute = TRUE, ..., when = TRUE, eval = TRUE, envir = parent.frame() )progressify( expr, substitute = TRUE, ..., when = TRUE, eval = TRUE, envir = parent.frame() )
expr |
An R expression. |
substitute |
If TRUE, |
when |
If TRUE (default), the expression is progressified, otherwise not. |
eval |
If TRUE (default), the progressified expression is evaluated, otherwise it is returned. |
envir |
The environment in which |
... |
Not used. |
Returns the value of the evaluated expression expr.
handlers(global = TRUE) # listen to progress updates xs <- list(1, 1:2, 1:2, 1:5) y <- lapply(X = xs, FUN = sum) |> progressify() str(y)handlers(global = TRUE) # listen to progress updates xs <- list(1, 1:2, 1:2, 1:5) y <- lapply(X = xs, FUN = sum) |> progressify() str(y)
List packages and functions supporting progressification
progressify_supported_packages() progressify_supported_functions(package)progressify_supported_packages() progressify_supported_functions(package)
package |
A package name. |
A character vector of package or function names.
pkgs <- progressify_supported_packages() pkgs fcns <- progressify_supported_functions("base") print(fcns) if (requireNamespace("purrr")) { fcns <- progressify_supported_functions("purrr") print(fcns) }pkgs <- progressify_supported_packages() pkgs fcns <- progressify_supported_functions("base") print(fcns) if (requireNamespace("purrr")) { fcns <- progressify_supported_functions("purrr") print(fcns) }