Skip to content

Provide some tidyselect like interface for facetting #4999

Open
@hadley

Description

@hadley

So you could do (e.g.)

diamonds |>
  ggplot() |>
  geom_histogram(aes(carat)) |>
  facet_wrap(vars_select(starts_with("c") & !carat))

(Motivating real function: https://twitter.com/avakiai/status/1574392928545513472)

I don't think this is that useful in direct analysis but it makes certain programmatic usages possible that are otherwise very hard.

Alternatively if it was possible to make facet_wrap(vars(data.frame(vs, cyl)) work, then we could attack the problem via across()/pick() which has the advantage of working the same way as in dplyr.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions