In a recent SO post this came up (changed example to simplify it
here). It seems that `test` still has the value sin.
test <- sin
environment(test)$test <- cos
test(0)
## [1] 0
It appears to be related to the double use of `test` in `$<-` since if
we break it up it works as expected:
Hello R folks,
Today I noticed that using the subset argument in lm() with a polynomial gives
a different result than using the polynomial when the data has already been
subsetted. This was not at all intuitive for me.You can see an example
here:
https://stackoverflow.com/questions/70490599
I agree that it seems non-intuitive (I can't think of a design reason
for it to look this way), but I'd like to stress that it's *not* an
information leak; the predictions of the model are independent of the
parameterization, which is all this issue affects. In a worst case there
might be som
On Mon, 27 Dec 2021, Gabor Grothendieck wrote:
In a recent SO post this came up (changed example to simplify it
here). It seems that `test` still has the value sin.
test <- sin
environment(test)$test <- cos
test(0)
## [1] 0
It appears to be related to the double use of `test` in `$<-` sin