# progressify: Progress Reporting of Common Functions via One Magic Function ![The hexlogo for the 'progressify' package](reference/figures/progressify-logo.png) ## TL;DR The **progressify** package makes it extremely simple to report progress updates for your existing map-reduce calls. All you need to know is that there is a single function called [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) that will take care of everything, e.g. \ `y`` ``<-`` `[`lapply`](https://rdrr.io/r/base/lapply.html)`(``x``, ``fcn``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ `y`` ``<-`` ``map``(``x``, ``fcn``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ `y`` ``<-`` ``foreach``(``x ``=`` ``xs``)`` ``%do%`` ``{`` ``fcn``(``x``)`` ``}`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ `res`` ``<-`` ``boot``::`[`boot`](https://rdrr.io/pkg/boot/man/boot.html)`(``data``, ``statistic``, R ``=`` ``100``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)` The [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) function signals progress updates via the **[progressr](https://progressr.futureverse.org)** package, meaning you can choose among the **[supported progressr handlers](https://progressr.futureverse.org/articles/progressr-11-handlers.html)** on how to render progress updates, whether it be via the terminal, a progress bar, or even a sound. The **progressify** package has only one hard dependency - the **[progressr](https://progressr.futureverse.org)** package. In addition to getting progress updates via **progressr**, by using [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) you also get access to all the benefits that come with **progressr**. Notably, you have full control over when and how progress is reported, and it works seamlessly across different environments and frontends. ## Supported map-reduce packages The **progressify** package supports transpilation of functions from multiple packages. The table below summarizes the supported map-reduce functions. To programmatically see which packages are currently supported, use: \ [`progressify_supported_packages`](https://progressify.futureverse.org/reference/progressify_supported_packages.md)`(``)` To see which functions are supported for a specific package, use: \ [`progressify_supported_functions`](https://progressify.futureverse.org/reference/progressify_supported_packages.md)`(``"purrr"``)` | Package | Functions | |----|----| | **base** | [`apply()`](https://rdrr.io/r/base/apply.html), [`by()`](https://rdrr.io/r/base/by.html), [`eapply()`](https://rdrr.io/r/base/eapply.html), [`lapply()`](https://rdrr.io/r/base/lapply.html), [`.mapply()`](https://rdrr.io/r/base/mapply.html), [`mapply()`](https://rdrr.io/r/base/mapply.html), [`Map()`](https://rdrr.io/r/base/funprog.html), [`replicate()`](https://rdrr.io/r/base/lapply.html), [`sapply()`](https://rdrr.io/r/base/lapply.html), [`tapply()`](https://rdrr.io/r/base/tapply.html), [`vapply()`](https://rdrr.io/r/base/lapply.html) | | **stats** | [`dendrapply()`](https://rdrr.io/r/stats/dendrapply.html) | | **[future.apply](https://future.apply.futureverse.org)** | `future_apply()`, `future_by()`, `future_eapply()`, `future_lapply()`, `future_.mapply()`, `future_mapply()`, `future_Map()`, `future_replicate()`, `future_sapply()`, `future_tapply()`, `future_vapply()` | | **[purrr](https://cran.r-project.org/package=purrr)** | `map()` and variants, `walk()` and variants, `map2()` and variants, `walk2()` and variants, `pmap()` and variants, `pwalk()`, `imap()` and variants, `modify()`, `modify2()`, `imodify()` | | **[crossmap](https://cran.r-project.org/package=crossmap)** | `xmap()` and variants, `xwalk()`, `map_vec()`, `map2_vec()`, `pmap_vec()`, `imap_vec()`, plus `future_*()` variants | | **[furrr](https://furrr.futureverse.org)** | `future_map()` and variants, `future_walk()` and variants, `future_map2()` and variants, `future_walk2()` and variants, `future_pmap()` and variants, `future_pwalk()`, `future_imap()` and variants, `future_modify()`, `future_modify2()`, `future_imodify()` and variants | | **[foreach](https://cran.r-project.org/package=foreach)** | `%do%`, `%dopar%` | | **[doFuture](https://doFuture.futureverse.org)** | `%dofuture%` | | **[plyr](https://cran.r-project.org/package=plyr)** | `llply()` and variants, `mlply()` and variants, `rdply()`, `rlply()`, `raply()`, `r_ply()` | *Table 1: Map-reduce functions currently supported by [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) for progress reporting.* Here are some examples: \ [`library`](https://rdrr.io/r/base/library.html)`(`[`progressify`](https://progressify.futureverse.org)`)`\ [`handlers`](https://progressr.futureverse.org/reference/handlers.html)`(``global ``=`` ``TRUE``)`\ \ `xs`` ``<-`` ``1``:``10`\ `ys`` ``<-`` `[`lapply`](https://rdrr.io/r/base/lapply.html)`(``xs``, ``function``(``x``)`` ``{`` `[`Sys.sleep`](https://rdrr.io/r/base/Sys.sleep.html)`(``0.1``)``; `[`sqrt`](https://rdrr.io/r/base/MathFun.html)`(``x``)`` ``}``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `d`` ``<-`` `[`as.dendrogram`](https://rdrr.io/r/stats/dendrogram.html)`(`[`hclust`](https://rdrr.io/r/stats/hclust.html)`(`[`dist`](https://rdrr.io/r/stats/dist.html)`(``USArrests``)``)``)`\ `d2`` ``<-`` `[`dendrapply`](https://rdrr.io/r/stats/dendrapply.html)`(``d``, ``function``(``n``)`` ``{`` `[`Sys.sleep`](https://rdrr.io/r/base/Sys.sleep.html)`(``0.01``)``; ``n`` ``}``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `xs`` ``<-`` ``1``:``10`\ `ys`` ``<-`` ``purrr``::`[`map`](https://purrr.tidyverse.org/reference/map.html)`(``xs``, ``function``(``x``)`` ``{`` `[`Sys.sleep`](https://rdrr.io/r/base/Sys.sleep.html)`(``0.1``)``; `[`sqrt`](https://rdrr.io/r/base/MathFun.html)`(``x``)`` ``}``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `xs`` ``<-`` `[`list`](https://rdrr.io/r/base/list.html)`(``1``:``5``, ``1``:``5``)`\ `ys`` ``<-`` ``crossmap``::`[`xmap`](https://pkg.rossellhayes.com/crossmap/reference/xmap.html)`(``xs``, ``~`` ``.y`` ``*`` ``.x``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ [`library`](https://rdrr.io/r/base/library.html)`(`[`foreach`](https://github.com/RevolutionAnalytics/foreach)`)`\ `xs`` ``<-`` ``1``:``10`\ `ys`` ``<-`` `[`foreach`](https://rdrr.io/pkg/foreach/man/foreach.html)`(``x ``=`` ``xs``)`` `[`%do%`](https://rdrr.io/pkg/foreach/man/foreach.html)` ``{`` `[`Sys.sleep`](https://rdrr.io/r/base/Sys.sleep.html)`(``0.1``)``; `[`sqrt`](https://rdrr.io/r/base/MathFun.html)`(``x``)`` ``}`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `xs`` ``<-`` ``1``:``10`\ `ys`` ``<-`` ``plyr``::`[`llply`](https://rdrr.io/pkg/plyr/man/llply.html)`(``xs``, ``function``(``x``)`` ``{`` `[`Sys.sleep`](https://rdrr.io/r/base/Sys.sleep.html)`(``0.1``)``; `[`sqrt`](https://rdrr.io/r/base/MathFun.html)`(``x``)`` ``}``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)` ## Supported domain-specific packages You can also progressify calls from a growing set of domain-specific CRAN packages that have optional built-in support for parallelization. ### CRAN packages with support for progressify | Package | Functions | |----|----| | **[boot](https://cran.r-project.org/package=boot)** | `boot()`, `censboot()`, `tsboot()` | | **[fwb](https://cran.r-project.org/package=fwb)** | `fwb()` | | **[lme4](https://cran.r-project.org/package=lme4)** | `bootMer()` | | **[partykit](https://cran.r-project.org/package=partykit)** | `cforest()` | | **[sandwich](https://cran.r-project.org/package=sandwich)** | `vcovBS()`, `vcovJK()` | | **[SimDesign](https://cran.r-project.org/package=SimDesign)** | `runSimulation()` | *Table 2: CRAN packages with domain-specific functions currently supported by [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) for progress reporting.* Here are some examples: \ `res`` ``<-`` ``boot``::`[`boot`](https://rdrr.io/pkg/boot/man/boot.html)`(``data``, ``statistic``, R ``=`` ``100``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `res`` ``<-`` ``fwb``::`[`fwb`](https://ngreifer.github.io/fwb/reference/fwb.html)`(``data``, ``statistic``, R ``=`` ``100``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `res`` ``<-`` ``lme4``::`[`bootMer`](https://rdrr.io/pkg/lme4/man/bootMer.html)`(``fit``, ``statistic``, nsim ``=`` ``100``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `forest`` ``<-`` ``partykit``::`[`cforest`](https://rdrr.io/pkg/partykit/man/cforest.html)`(``Survived`` ``~`` ``.``, data ``=`` `[`as.data.frame`](https://rdrr.io/r/base/as.data.frame.html)`(``Titanic``)``, ntree ``=`` ``50L``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `v`` ``<-`` ``sandwich``::`[`vcovBS`](https://zeileis.codeberg.page/sandwich/reference/vcovBS.html)`(``fit``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`\ \ `res`` ``<-`` ``SimDesign``::`[`runSimulation`](http://philchalmers.github.io/SimDesign/reference/runSimulation.md)`(``design``, ``replications``, ``generate``, ``analyse``, ``summarise``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)` ## Compatible with futurize The **progressify** package is compatible with the **[futurize](https://futurize.futureverse.org)** package, which parallelizes code via the [futureverse](https://www.futureverse.org). You can combine the two, in either order, to get both progress reporting and parallelization: \ [`library`](https://rdrr.io/r/base/library.html)`(`[`progressify`](https://progressify.futureverse.org)`)`\ [`handlers`](https://progressr.futureverse.org/reference/handlers.html)`(``global ``=`` ``TRUE``)`\ \ [`library`](https://rdrr.io/r/base/library.html)`(`[`futurize`](https://futurize.futureverse.org)`)`\ [`plan`](https://future.futureverse.org/reference/plan.html)`(``multisession``)`\ \ `xs`` ``<-`` ``1``:``100`\ `ys`` ``<-`` `[`lapply`](https://rdrr.io/r/base/lapply.html)`(``xs``, ``slow_fcn``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`` ``|>`` `[`futurize`](https://futurize.futureverse.org/reference/futurize.html)`(``)`\ \ `ys`` ``<-`` ``purrr``::`[`map`](https://purrr.tidyverse.org/reference/map.html)`(``xs``, ``slow_fcn``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`` ``|>`` `[`futurize`](https://futurize.futureverse.org/reference/futurize.html)`(``)`\ \ [`library`](https://rdrr.io/r/base/library.html)`(`[`foreach`](https://github.com/RevolutionAnalytics/foreach)`)`\ `ys`` ``<-`` `[`foreach`](https://rdrr.io/pkg/foreach/man/foreach.html)`(``x ``=`` ``xs``)`` `[`%do%`](https://rdrr.io/pkg/foreach/man/foreach.html)` ``{`` ``slow_fcn``(``x``)`` ``}`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`` ``|>`` `[`futurize`](https://futurize.futureverse.org/reference/futurize.html)`(``)`\ \ `ys`` ``<-`` ``plyr``::`[`llply`](https://rdrr.io/pkg/plyr/man/llply.html)`(``xs``, ``slow_fcn``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`` ``|>`` `[`futurize`](https://futurize.futureverse.org/reference/futurize.html)`(``)`\ \ `forest`` ``<-`` ``partykit``::`[`cforest`](https://rdrr.io/pkg/partykit/man/cforest.html)`(``dist`` ``~`` ``speed``, data ``=`` ``cars``, ntree ``=`` ``50L``)`` ``|>`` `[`progressify`](https://progressify.futureverse.org/reference/progressify.md)`(``)`` ``|>`` `[`futurize`](https://futurize.futureverse.org/reference/futurize.html)`(``)` # Package index ## All functions - [`progressify()`](https://progressify.futureverse.org/reference/progressify.md) : Evaluate a regular map-reduce call with progress updates - [`progressify_supported_packages()`](https://progressify.futureverse.org/reference/progressify_supported_packages.md) [`progressify_supported_functions()`](https://progressify.futureverse.org/reference/progressify_supported_packages.md) : List packages and functions supporting progressification # Articles ### All vignettes - [Progress updates for base-R apply functions](https://progressify.futureverse.org/articles/progressify-11-base.md): - [Progress updates for 'stats' functions](https://progressify.futureverse.org/articles/progressify-11-stats.md): - [Progress updates for 'future.apply' functions](https://progressify.futureverse.org/articles/progressify-12-future.apply.md): - [Progress updates for 'purrr' functions](https://progressify.futureverse.org/articles/progressify-21-purrr.md): - [Progress updates for 'furrr' functions](https://progressify.futureverse.org/articles/progressify-22-furrr.md): - [Progress updates for 'crossmap' functions](https://progressify.futureverse.org/articles/progressify-23-crossmap.md): - [Progress updates for 'foreach' functions](https://progressify.futureverse.org/articles/progressify-41-foreach.md): - [Progress updates for 'plyr' functions](https://progressify.futureverse.org/articles/progressify-51-plyr.md): - [Progress updates for 'boot' functions](https://progressify.futureverse.org/articles/progressify-81-boot.md): - [Progress updates for 'fwb' functions](https://progressify.futureverse.org/articles/progressify-81-fwb.md): - [Progress updates for 'lme4' functions](https://progressify.futureverse.org/articles/progressify-81-lme4.md): - [Progress updates for 'partykit' functions](https://progressify.futureverse.org/articles/progressify-81-partykit.md): - [Progress updates for 'sandwich' functions](https://progressify.futureverse.org/articles/progressify-81-sandwich.md): - [Progress updates for 'SimDesign' functions](https://progressify.futureverse.org/articles/progressify-81-SimDesign.md):