View source: R/handler_callback.R
| handler_callback | R Documentation |
A progression handler that calls a custom hook function every time this handler receives a progression update, e.g. to forward progress information to logging, GUIs, or other external systems not supported by progressr.
handler_callback(
fcn = NULL,
intrusiveness = getOption("progressr.intrusiveness.callback", 1),
target = "callback",
...
)
fcn |
(function) A hook function that is called whenever this
handler reports on an |
intrusiveness |
(numeric) A non-negative scalar on how intrusive (disruptive) the reporter to the user. |
target |
(character vector) Specifies where progression updates are rendered. |
... |
Additional arguments passed to |
A function of class progression_handler that takes a
progression condition as its first and only argument.
handlers(handler_callback(fcn = function(type, step, max_steps, message, amount, ...) {
message(sprintf("[%s] step %d/%d (%+g): %s", type, step, max_steps, amount, message))
}))
with_progress({ y <- slow_sum_p(1:10) })
print(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.