I did not know about ggplot_build() before. It can come in handy in situations where you want to access computed metrics of a #ggplot. https://ggplot2.tidyverse.org/reference/ggplot_build.html. Thanks @thedatainklab for sharing. #rstats #ci
Build ggplot for rendering. — ggplot_build

build_ggplot() takes the plot object, and performs all steps necessary to produce an object that can be rendered. This function outputs two pieces: a list of data frames (one for each layer), and a panel object, which contain all information about axis limits, breaks etc. The ggplot_build() function is vestigial and build_ggplot() should be used instead.

ggplot_build() is one of those functions that keeps paying off. I use it mostly when a stat layer gives unexpected output. The computed aesthetics in $data show exactly where the transformation went sideways, which is faster than re-reading the stat documentation.