Colors and Residual-based Shadings in the Strucplot Framework

Unlike other graphics functions in base R, the strucplot framework allows almost full control over the graphical parameters of all plot elements. In particular, in association plots, mosaic plots, and sieve plots, the user can modify the graphical appearance of each tile individually. Built on top of this functionality, the framework supplies a set of shading functions choosing colors appropriate for the visualization of log-linear models. The tiles’ graphical parameters are set using the gp argument of the functions of the strucplot framework. This argument basically expects an object of class gpar whose components are arrays of the same shape (length and dimensionality) as the data table (see Section 2). For convenience, however, the user can also supply a specialized graphical appearance control (“grapcon”) function that computes such an object given a vector of residuals, or, alternatively, a generating function that takes certain arguments and returns such a grapcon function (see Section 3). We provide several shading functions, including support for both HSV and HCL colors, and the visualization of significance tests (see Section 4).