View source: R/output-handler.R
new_output_handler | R Documentation |
An output_handler
handles the results of evaluate()
,
including the values, graphics, conditions. Each type of output is handled by
a particular function in the handler object.
new_output_handler(
source = identity,
text = identity,
graphics = identity,
message = identity,
warning = identity,
error = identity,
value = render,
calling_handlers = list()
)
source |
Function to handle the echoed source code under evaluation.
This function should take two arguments ( Return |
text |
Function to handle any textual console output. |
graphics |
Function to handle graphics, as returned by
|
message |
Function to handle |
warning |
Function to handle |
error |
Function to handle |
value |
Function to handle the values returned from evaluation.
|
calling_handlers |
List of calling handlers.
These handlers have precedence over the exiting handler installed
by |
The handler functions should accept an output object as their first argument.
The return value of the handlers is ignored, except in the case of the
value
handler, where a visible return value is saved in the output
list.
Calling the constructor with no arguments results in the default handler, which mimics the behavior of the console by printing visible values.
Note that recursion is common: for example, if value
does any
printing, then the text
or graphics
handlers may be called.
A new output_handler
object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.