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

Feature request: rlang/purrr-style anonymous functions in stat_function #3159

Closed
dkahle opened this issue Feb 22, 2019 · 3 comments
Closed

Feature request: rlang/purrr-style anonymous functions in stat_function #3159

dkahle opened this issue Feb 22, 2019 · 3 comments

Comments

@dkahle
Copy link
Contributor

@dkahle dkahle commented Feb 22, 2019

It'd be nice to be able to specify rlang/purrr style anonymous functions in stat_function():

df <- data.frame(x = 1:10, y = (1:10)^2)
ggplot(df, aes(x, y)) + 
  geom_point() +
  stat_function(fun = ~ .x^2)

Associated pull request forthcoming.

@yutannihilation
Copy link
Member

@yutannihilation yutannihilation commented Feb 22, 2019

@hadley @thomasp85 @clauswilke
Because of the popularity of rlang-style lambda notation among tidyverse packages, I think it's natural to accept this proposal. (I'm going to make similar changes all over the places in ggplot2 where the users can use functions). Any concerns?

@clauswilke
Copy link
Member

@clauswilke clauswilke commented Feb 22, 2019

Other than the comments I made, no concerns.

@lock
Copy link

@lock lock bot commented Sep 4, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants