Best practices for programming with ggplot2
summary
Reverse dependency checks find ~1,500 packages that import ggplot2 and >2,500 that suggest it, so concrete patterns matter: use the dot_data pronoun to let aes and facet specs accept string inputs; build the mapping and facet objects at the top so they can be conditionally removed; add NULL to a plot to mean “do nothing” instead of creating separate plot branches; import ggplot2 functions in the NAMESPACE to avoid ggplot2:: clutter; test images with vdiffr and expect_doppelganger after making a deterministic data generator.
AI-written summary · about
chapters (4)
- 0:00Start
- 12:15Using ggplot2 in packages: namespacing
- 13:41Using ggplot2 in packages: undefined variables
- 15:03Using ggplot2 in packages: testing
related talks
01h 01m50 ways to show your data
18mFrom idea to code to image: Creative data visualizations in R
34mVisualising Multi Dimensional Data
14mAdding a Touch of glitr: Developing a Package of Themes on Top of ggplot
19mCracking open ggplot internals with {ggtrace}
30mFrom plotting to chart porn - Creating slick charts with Matplotlib
01h 26mTurning DataFrames into Pretty Pictures with Plotnine
16mWho are 'the ggplot2 extenders' and how to become one
