Residual-Shaded Mosaic Plots for 'ggplot2'

A 'ggplot2'-native alternative to the shaded mosaic plots drawn by mosaicplot() in base 'R'. geom_mosaic_resid() maps two categorical variables with ordinary 'ggplot2' aesthetics, recursively partitions the unit square into tiles sized by their joint proportions, computes Pearson, deviance, or Freeman-Tukey residuals against a two-way independence model, and maps the residuals to fill color. It works on raw data, already aggregated counts, or contingency tables, and the tile geometry and residuals are also returned as a data frame by compute_mosaic_residuals().


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mosaicresid")

0.1.1 by Sam Butler, 9 hours ago


https://github.com/sbutler22/geom_mosaic


Report a bug at https://github.com/sbutler22/geom_mosaic/issues


Browse source code at https://github.com/cran/mosaicresid


Authors: Sam Butler [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, dplyr, tibble, purrr, rlang

Suggests testthat, knitr, rmarkdown, S7


See at CRAN