You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When overriding existing functions form base packages, use the following helper function to dispatch to existing functions without hard-coding their exact namespace:
previous_definition=function (name) {
# Skip the parent environment of the calling frame.
get(name, envir= parent.env(parent.env(parent.frame())))
}
This allows multiple redefinitions layered on top of each other (unlike e.g. devtools::help, which does this “wrong”). For an example of usage, see this Stack Overflow answer.
The text was updated successfully, but these errors were encountered:
When overriding existing functions form base packages, use the following helper function to dispatch to existing functions without hard-coding their exact namespace:
This allows multiple redefinitions layered on top of each other (unlike e.g.
devtools::help
, which does this “wrong”). For an example of usage, see this Stack Overflow answer.The text was updated successfully, but these errors were encountered: