setHook
set_hooks(hooks, action = "append")
"replace"
"append"
"prepend"
new <- list(before.plot.new = function() print("Plotted!")) hooks <- set_hooks(new) plot(1) set_hooks(hooks, "replace") plot(1)
Run the code above in your browser using DataCamp Workspace