set_hooks: Set hooks.

View source: R/hooks.r

set_hooksR Documentation

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 documentation built on March 18, 2022, 6:45 p.m.