Skip to content

Accept tidyverse tilde functions #4103

Closed
@davidsjoberg

Description

@davidsjoberg

It would be neat to be able to use the same "short" version of defining function as in purrr in ggplot2 as well.


Example would be to be able to write:

ggplot(mtcars, aes(drat, qsec)) + 
  geom_line() +
  scale_y_continuous(labels = ~format(., nsmall = 1))

Today you need to do like this:

ggplot(mtcars, aes(drat, qsec)) + 
  geom_line() +
  scale_y_continuous(labels = function(x) format(x, nsmall = 1))

Thanks! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions