Description Usage Arguments Details Value
View source: R/replaceFunctionByReference.R
Replaces a function with a new value, taking care of consistent placement in the search path
1 | replaceFunctionByReference(name, newFunc, startEnv = environment())
|
name |
character; name of the function to replace |
newFunc |
function; new value |
startEnv |
environment; where to start looking for 'name' |
Tries to consistently take care of locked environments
by creating a "cachified" unlocked environment one position upstream in the search path
and assigning the new function there.
Cachified functions need special care because they don't work without their
enclosing environment. This is dealt with by leaving a cachified new function
in its enclosing environment and only setting the parent to
the enclosing environment of the original function
no return; the first instance of 'name' on the search path will be replaced by newFunc.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.