-
Notifications
You must be signed in to change notification settings - Fork 158
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
Functions with envir = parent.frame() #38
Comments
I have the same problem. For my digging, function "pipe" do evaluate "load" and load all variables into the new environment, but this code below returns result with visible = FALSE (L43 in pipe.R).
So pipe returns results with invisible (L53 in pipe.R)
Not sure how to fix it. |
This is one of those things that keep popping up; on the one hand I am not a fan of side-effect functions like e.g. load, and typically I wrap it in a function which returns whatever is loaded; in general depending "too much" on the environments around is not really good practice. That being said, I know it would be nice to solve this, but to be honest, I am not sure there is an easy fix for it. I'll keep it in mind though... |
Thanks for your reply. Andri and Richard Scriven at Stackoverflow provided a solution and explanation: |
Generally, I think it's better to use |
This issue affects all functions with the construct Compare (from an interactive prompt):
How about something like the following:
The I have looked, but haven't found a way to make |
I think the best we can do is to provide a convenient way to get the right environment, i.e. #171. I'm now almost certain that that's no way to implement the pipe that would preserve |
I've just found another problem with the If I save a data frame with pipe:
And later, when I don't have it in the Global Env, I try to load with
it does not load anything. If I save it without pipe, all works as usual. |
Compare the following two statements:
The former will load the data into a temporary environment; the reason is that
load
is declared asThe same happens with
assign
andget
.This is at least unexpected, I'm not sure if we should call it a bug. Worse, I'm not sure if this issue can be solved at all in a robust way.
Similar to #32.
The text was updated successfully, but these errors were encountered: