tidyverse/ggplot2

bug(API): Missing exported `build_ggplot()`

Closed this issue · 1 comments

Related:

Had to do a small consession because I already used build_ggplot() in rstudio/thematic#156 which is already on CRAN.

Originally posted by @teunbrand in #6546 (comment)


GGally also includes build_ggplot() in tests as it was documented to be the way to assemble plots. (First seen in https://github.com/ggobi/ggally/actions/runs/16751131331/job/47421425019?pr=554)

Please let me know which method I should use and {GGally} can make another release. Thank you!

You can use the S3 generic ggplot_build() and you can write S7 or S3 methods for it.

We originally wanted to update ggplot_build() to an S7 generic, but because you cannot write S3 methods for it ---and some packages did write S3 methods for it--- it was disruptive. So build_ggplot() became an S7 intermediate, until we realised you can write S7 methods for S3 generics, so now we're back to S3 ggplot_build(). S7 has the plan to let S7 generics fall back to S3 methods when available, at which point we can make ggplot_build() an S7 generic properly.