Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

new_output_handler

Custom output handlers.


Description

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.

Usage

new_output_handler(source = identity, text = identity, graphics = identity, 
    message = identity, warning = identity, error = identity, value = render)

Arguments

source

Function to handle the echoed source code under evaluation.

text

Function to handle any textual console output.

graphics

Function to handle graphics, as returned by recordPlot().

message

Function to handle message() output.

warning

Function to handle warning() output.

error

Function to handle stop() output.

value

Function to handle the values returned from evaluation. If it only has one argument, only visible values are handled; if it has more arguments, the second argument indicates whether the value is visible.

Details

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.

Value

A new output_handler object


evaluate

Parsing and Evaluation Tools that Provide More Details than the Default

v0.14
MIT + file LICENSE
Authors
Hadley Wickham [aut], Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>), Michael Lawrence [ctb], Thomas Kluyver [ctb], Jeroen Ooms [ctb], Barret Schloerke [ctb], Adam Ryczkowski [ctb], Hiroaki Yutani [ctb], Michel Lang [ctb], Karolis Koncevičius [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.