Closed
Description
I'd like to be able to put expressions in faceted formulae instead of just column names.
For example, I'd like to be able to facet by a "cut" of a column:
ggplot(mtcars, aes(qsec, mpg)) +
geom_point() +
facet_wrap(~ cut(wt, c(0, 2, 4, 6)))
rather than needing to do something like:
mtcars$cut <- cut(mtcars$wt, c(0, 2, 4, 6))
ggplot(mtcars, aes(qsec, mpg)) +
geom_point() +
facet_wrap(~ cut)