Patchwork 1.3 — An Update for R Programming
Learn about the latest version of the Tidyverse data visualization library for R programming
Patchwork is a handy library for managing multiple graphs. If you use ggplot2 a lot (and most R programming data scientists do), you will see the library whenever multiple plots are needed for a dashboard or a simple visual in Shiny.
The Patchwork library received an update. The blog for Patchwork noted that a deeper integration with gt tables is now possible. This means you have native support for gt objects, making it possible to compose formatted tables alongside graphs and visuals.
Displaying Tables and Graphs Together in Patchwork
To show how this works, I am displaying an example using the mtcars dataset.
The first two plots are associated with the data in the dataset, a plot of engine displacement in cubic inches versus the mpg, with color according to the cylinders in the engine (A quick aside about the legend — Yes, I know there is no 7 cylinder engine in existence, let alone in the dataset, but I did not adjust it because it’s not important to the overall explanation! :-)