replaceFunctionByReference: Replaces a function with a new value, taking care of...

Description Usage Arguments Details Value

View source: R/replaceFunctionByReference.R

Description

Replaces a function with a new value, taking care of consistent placement in the search path

Usage

1

Arguments

name

character; name of the function to replace

newFunc

function; new value

startEnv

environment; where to start looking for 'name'

Details

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

Value

no return; the first instance of 'name' on the search path will be replaced by newFunc.


fnbn/cachifyR documentation built on May 5, 2019, 6:58 p.m.