Learn R Programming

riemtan (version 0.2.5)

with_progress_signal: Execute Function with Progress Reporting for Each Item

Description

Helper function that wraps a function to report progress after each invocation. Useful for integrating progress reporting with purrr::map() or furrr::future_map().

Usage

with_progress_signal(.f, .p)

Value

A wrapped function that calls .f(x) and then signals progress via .p().

Arguments

.f

Function to wrap

.p

Progressor function created by create_progressor() or progressr::progressor()

Details

This is an internal utility function used by riemtan's parallel processing functions.

Examples

Run this code
if (FALSE) {
progressr::handlers("progress")

result <- with_progress({
  p <- progressr::progressor(steps = 10)
  wrapped_fn <- with_progress_signal(sqrt, p)
  lapply(1:10, wrapped_fn)
})
}

Run the code above in your browser using DataLab