Skip to content
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

Add documentation of .env vs. unquoting #339

Merged
merged 2 commits into from
Jan 6, 2018
Merged

Add documentation of .env vs. unquoting #339

merged 2 commits into from
Jan 6, 2018

Conversation

karldw
Copy link
Contributor

@karldw karldw commented Jan 5, 2018

I added a little documentation to capture @lionel-'s comments from tidyverse/dplyr#3286. Feel free to merge if this is helpful, not worries if it's not.

I added a few examples that use magrittr pipes (%>%), but \dontrun{}-ed run them to avoid making magrittr a dependency.

Add a few examples that use magrittr pipes (%>%), but don't run them to
avoid making magrittr a dependency.
@lionel-
Copy link
Member

lionel- commented Jan 5, 2018

The formulation is not quite right: it's not .env that doesn't look through parents, but the $ operator. Also it looks like the two magrittr examples are the same.

@karldw
Copy link
Contributor Author

karldw commented Jan 5, 2018

Oops, thanks. Is it correct to say ".env$ will not look in a parent environment, while unquoting will."?

@lionel-
Copy link
Member

lionel- commented Jan 5, 2018

Secondly, subsetting .env with the $ operator may be brittle because $ does not look through the parents of the environment. Using .env$name in a magrittr pipeline is an instance where this poses problem because the magrittr pipe currently evaluates its operands in a child of the current environment (this is where it defines the pronoun .).

@lionel-
Copy link
Member

lionel- commented Jan 6, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants