Skip to content
Prev 161774 / 398500 Next

function that uses a variable name as the parameter

On 12/11/2008 7:59 AM, David Croll wrote:
That's not a good idea:  it looks as though you're trying to fake "call 
by reference" in a call by value language.  R is flexible enough to do 
it (use substitute() to change the arg into a string, get() to get the 
old value, assign() to put it back), but the behaviour will be really 
weird, and you'll probably run into problems later.  R is not C.

Duncan Murdoch