-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Results change when environment supplied (envir=) to evaluate #57
Comments
I think I have found a workaround:
|
No, I fooled myself, the above workaround does not work. The best I can come up with is to modify the code to assign print.dog into the global environment:
|
This could be either a bug or feature. If I don't see a straightforward fix. If you want to give it a try, you may start from https://github.com/hadley/evaluate/blob/master/R/eval.r#L158-L163 The |
Hi @yihui, Thanks, I understand your point. I think in my case that I can work around my problem by using envir=globalenv(). In some respects this is a righteous solution because it more like the real R command line. I have not closed this Issue because perhaps someone else will follow my path, but I do not mind if it is closed. |
Okay, I'll wait for one more vote before tackling this problem :) |
S3 method registration in the global environment has changed quite a bit in the last ~8 years , so I'm closing this because it's likely no longer relevant. |
I get a different result when executing the code below, depending on whether I supply a new environment. I am using evaluate 0.8 on R 3.2.2.
produces
but
produces
which I think is correct. Unfortunately for me I would like to replace the environment.
I guess that the print.dog function is being put in e, but that whatever handles the default printing of visible values is not executing in that environment. I have stared at eval.R and I cannot work out what makes visible values print. Any clues?
The text was updated successfully, but these errors were encountered: