tidyverse / ggplot2

An implementation of the Grammar of Graphics in R
https://ggplot2.tidyverse.org
Other
6.52k stars 2.02k forks source link

Tidy evaluation #2412

Closed hadley closed 6 years ago

hadley commented 6 years ago

Work occurring in tidyeval branch

df <- data.frame(x = 0, y = 0)
ggplot(df, aes(x, y)) + geom_point()

z1 <- new_quosure(expr(z), env(z = 1))
z2 <- new_quosure(expr(z), env(z = 1:2))
aes(!!z1, !!z2)

ggplot(df, aes(x, y)) + geom_point()
ggplot(df, aes(!!z1, y)) + geom_point()
ggplot(df, aes(x, y)) + geom_point(aes(!!z1))

Need to figure out how to represent facetting spec using quosures

Small fixes :

hadley commented 6 years ago

@lionel- did you look at either of the currently unchecked boxes?

lionel- commented 6 years ago

I don't think so, would you like me to?

hadley commented 6 years ago

Yeah, it’d be helpful to spend an hour or two on, in total.

lionel- commented 6 years ago

Sure thing, will do tomorrow morning.

lionel- commented 6 years ago

The tryapply() seems to have been there from the start of revision history: https://github.com/tidyverse/ggplot2/commit/6198457400c66d0774006c75353a1e7f1dd2806a#diff-70a17f07da991e42a800284db537be0aR106. You probably used it just to be on the safe side? It seems to make sense to just evaluate plainly though.

subset appears to have stopped working with the 2.0 rewrite: https://stackoverflow.com/questions/34588232/subset-parameter-in-layers-is-no-longer-working-with-ggplot2-2-0-0/34588455#34588455

hadley commented 6 years ago

Ok, I'll remove subset argument since it's clearly been broken for a while, and tryapply() since it no longer seems necessary.

lock[bot] commented 6 years ago

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/