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

set_hooks

Set hooks.


Description

This wraps the base setHook() function to provide a return value that makes it easy to undo.

Usage

set_hooks(hooks, action = "append")

Arguments

hooks

a named list of hooks - each hook can either be a function or a list of functions.

action

"replace", "append" or "prepend"

Examples

new <- list(before.plot.new = function() print("Plotted!"))
hooks <- set_hooks(new)
plot(1)
set_hooks(hooks, "replace")
plot(1)

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.