| progress_lapply | R Documentation |
lapply with progressDrop-in replacement for lapply() that reports progress after each
element: begins a progress node, ticks once per element, and ends the
node. Nested calls produce a nested breadcrumb on the console (and
parent_id-chained sink events). If fn throws, the node is ended with
status = "error" before the condition propagates, so nested wrappers
unwind cleanly.
progress_lapply(
X,
FUN,
...,
label = "Processing",
kind = "progress",
parent_id = NULL,
verbosity = NULL,
package = NULL,
output_type = NULL
)
X |
Vector or list: Elements to iterate over, as in |
FUN |
Function: Applied to each element of |
... |
Additional arguments passed to |
label |
Character: Display label for the progress node. |
kind |
Character: Node kind forwarded in the sink envelope. |
parent_id |
Character or NULL: Parent id for the sink envelope when
this is the outermost active handle - see |
verbosity |
Integer or NULL: Overrides |
package |
Character or NULL: Package name for verbosity override lookup. |
output_type |
Character or NULL: |
message() and warning() conditions signalled by fn (or anything it
calls) are intercepted by a calling handler that clears the status line
before the text is printed, then lets normal handling proceed - so
third-party verbose output lands on a clean line. Direct stdout writes
(cat(), print()) cannot be intercepted; see progress_clear().
List: Exactly what lapply(X, FUN, ...) returns.
EDG
Other progress:
progress_begin(),
progress_clear(),
progress_end(),
progress_update()
sqrts <- progress_lapply(
1:4,
sqrt,
label = "Computing",
output_type = "plain"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.