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().
| Version: | 0.1.1 |
| Depends: | R (≥ 4.1.0) |
| Imports: | ggplot2 (≥ 3.4.0), dplyr, tibble, purrr, rlang |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown, S7 |
| Published: | 2026-11-20 |
| DOI: | 10.32614/CRAN.package.mosaicresid (may not be active yet) |
| Author: | Sam Butler [aut, cre] |
| Maintainer: | Sam Butler <swmbutler at gmail.com> |
| BugReports: | https://github.com/sbutler22/geom_mosaic/issues |
| License: | MIT + file LICENSE |
| URL: | https://github.com/sbutler22/geom_mosaic |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | mosaicresid results |
| Reference manual: | mosaicresid.html , mosaicresid.pdf |
| Vignettes: |
mosaicresid vs base R mosaicplot() vs ggmosaic2 (source, R code) Getting Started with mosaicresid (source, R code) |
| Package source: | mosaicresid_0.1.1.tar.gz |
| Windows binaries: | r-devel: not available, r-release: mosaicresid_0.1.1.zip, r-oldrel: not available |
| macOS binaries: | r-release (arm64): mosaicresid_0.1.1.tgz, r-oldrel (arm64): mosaicresid_0.1.1.tgz, r-release (x86_64): mosaicresid_0.1.1.tgz, r-oldrel (x86_64): mosaicresid_0.1.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=mosaicresid to link to this page.