Replies: 1 comment 15 replies
-
I think the concept of delayed evaluation is enormously convenient and helps to propel you from a proficient ggplot2 user to an advanced user if you wield it properly. I don't really care too much about whether the verb is declarative or procedural as these terms mean very little to me (sorry June!). Behind the scenes some complicated data masking and selection of mapping variables is going on, which is a bit of a pain to deal with from a maintenance perspective. You may have noticed that I'm not saying the following is ideal, but to get the conversation rolling, it might be something like:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
IDK what propelled me to do this but last night I went down a rabbit hole of how we got to
after_stat()
in ggplot.The timeline as I understand it:
..x..
syntax (ggplot2 initial commit)calc(x)
syntax that briefly existed between the v2-v3 transitionstat(x)
syntax which marked v3.0 (and thus wiping any mention ofcalc(x)
in NEWS for v3.0)after_stat(x)
syntax in v3.4, which also introducedstage()
andafter_scale()
And my own 5.5 contribution: the
stage(after_stat = x)
syntax whose status as off-label usage had kinda been up in the air but now codified into the docs in 2024 😛From a quick and dirty code search on GitHub (with some false positives), I see:
..x..
has 15.9k hits (CRAN only: 328 hits)calc(x)
has just 79 hits (CRAN only: a single hit from{ggformula}
)stat(x)
has 2k hits (CRAN only: 53 hits)after_stat(x)
has 6k hits (CRAN only: 578 hits)stage(after_stat = x)
has a single hit from{ggpmisc}
by @aphalo !! (note thatstage()
itself only has around 500 hits)Some other fun stuff:
calc(x)
! https://github.com/tidyverse/ggplot2/pull/2319/filesBeta Was this translation helpful? Give feedback.
All reactions