Martin C. Martin
2006-Oct-05 00:15 UTC
[Rd] update.default evaluating in wrong environment?
Hi all, update.default, which is the method used to update "lm" objects (among others), extracts the "call" element from it's first argument, updates it, then evaluates it in the parent.frame(). Shouldn't it be evaluated in environment(formula(object)), if that's non-NULL? I ask because I call "lm" from within a function, and the data argument is a local variable of that function. After that, I can't update the model any more, since the new lm() call (the one evaled in parent.frame()) can't find the data. Best, Martin
Martin C. Martin
2006-Oct-05 00:16 UTC
[Rd] update.default evaluating in wrong environment?
Hi all, update.default, which is the method used to update "lm" objects (among others), extracts the "call" element from it's first argument, updates it, then evaluates it in the parent.frame(). Shouldn't it be evaluated in environment(formula(object)), if that's non-NULL? I ask because I call "lm" from within a function, and the data argument is a local variable of that function. After that, I can't update the model any more, since the new lm() call (the one evaled in parent.frame()) can't find the data. Best, Martin