-
Notifications
You must be signed in to change notification settings - Fork 39
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
Allow extra sources of pronouns in f_eval() #54
base: master
Are you sure you want to change the base?
Conversation
Could you provide some motivation for this? |
I am writing a ggplot2 Stat that draws regression lines based on fitted models. That's useful to have in addition to StatSmooth because in this case the model parameters are estimated from the whole data and not just within groups, so it helps seeing how the model smoothes the predictions. To make it work I need to map the ggplot grouping aesthetics to the model inputs, which can mostly be figured out automatically except in one case. It's often useful to cut a continuous predictor into discrete ranges to plot how two continuous predictors interact. In this case I need a way to map the levels of the binned predictor to a value on the original continuous scale. So the Stat has a aes_patterns <- list(
hp = levels(.aes$colour) ~ means_equal_sizes(.data$hp)
) It's useful to have |
Ok, I think that makes sense. But I think you should use |
Should I rename |
I was thinking you'd automatically prefix with |
ok, I thought that would feel a bit magical |
Here you go @hadley |
@kevinushey suggested an alternative approach: To force the lookups of 'x', 'y' and 'z' to occur in df, you would probably write:
Or, you could potentially just do something like
Or even just
as an alternate mechanism of denoting where particular symbols should be looked up. I wonder if a generic bind would be a better solution here |
IIUC, I think these are orthogonal:
|
But I'm not sure I get it. I don't see the difference between your third example and the current approach. And the list is supposed to be named right? |
This adds an
explicit
argument tof_eval()
to provide additional pronouns. Contrarily todata
, the contents of these pronouns cannot be accessed directly and must be qualified with the relevant pronoun.