R programming - how to create small multiples diagram using facet_wrap and facet_grid from ggplot2

Published 2022-10-12
Using the facet_wrap and facet_grid functions of ggplot2 to create small multiples diagrams from an initial line diagram. The first example shows the small multiples in columns using facet_wrap, the second example shows the small multiples in rows using facet_grid.

Timings:
00:00 Introduction
00:35 The data used in the charts
01:39 Set up line diagram
03:17 Create facet_wrap diagram
04:50 Additional changes to facet_wrap
07:25 Create facet_grid diagram
09:00 Additional changes to facet_grid
10:05 Discuss facet_grid based on columns

The line diagram video mentioned in this video at 01:34 can be found at
   • How to create line chart with points ...  

Resources which may be helpful when using facet_wrap or facet_grid:
ggplot2.tidyverse.org/reference/facet_wrap.html
ggplot2.tidyverse.org/reference/facet_grid.html
ggplot2-book.org/facet.html

#rprogramming #ggplot2 #facet_grid #facet_wrap #smallmultiples #data #datavisualisation

All Comments (2)