Time as a Conditioning or Grouping Variable

Óscar Perpiñán Lamigueiro · 2025

In previous sections we learned to display the time evolution of multiple time series with different scales. But, what if instead of displaying the time evolution we want to represent the relation between the variables? This chapter follows this approach: first, the scatterplot matrix is proposed with groups defined according to the time as a grouping variable; next, an enhanced scatterplot is produced with time as a conditioning variable using the small multiples technique; finally, the hexagonal binning is discussed for large datasets. Along this chapter these subjects are covered: scatterplot matrices, small multiples, hexagonal binning, and panel functions. The most relevant packages in this chapter are: for reading and arranging data as time series; for creating the scatterplot matrix with ggplot2 ; for hexagonal binning; for converting data from the wide format to the long format.

Read the paper · More papers on PaperTik