Skip to content

ggmosaic2

0.5.1Package record

Mosaic Plots in the 'ggplot2' Framework, Extended

0packages depend
2.2Kdownloads / year
86.2%test coverage
13/13flavors OK

Overview

About

Mosaic plots in the 'ggplot2' framework. Mosaic plot functionality is provided in a single 'ggplot2' layer by calling the geom 'mosaic'. This extends the now-defunct 'ggmosaic' package by allowing fitted loglinear models which can be used to show patterns of association among variables in frequency tables.

Changes in 0.5.1
  • Addressed CRAN review feedback: added \value documentation to the GeomMosaic, GeomMosaicJitter, GeomMosaicText, StatMosaic, StatMosaicJitter, and StatMosaicText ggproto objects; fixed a broken prodcalc() example (a stray library(productplots) call was masking its offset argument) and unwrapped it; and replaced \dontrun with \donttest for the larger geom_mosaic() example block.
  • Added facet_mosaic_grid() for mosaic-aware faceting (haleyjeppson/ggmosaic#78): each facet panel gets independent x/y product scales and category axes drawn at panel-specific positions, and it supports multiple mosaic layers, theme_mosaic(), coord_flip(), manual product scales, margins, and residual shading.
  • Mosaic layers (geom_mosaic(), geom_mosaic_text(), geom_mosaic_jitter()) now resolve their plot mapping at build time, like ordinary ggplot2 layers, so an aes() mapping added or changed after a mosaic layer has already been added is now picked up correctly instead of being frozen at the point the layer was added.
Show all changes in 0.5.1Hide the rest of the changes in 0.5.1
  • Added mosaic_settings() for sharing divider, offset, and expected across sibling mosaic layers in one plot, so multi-layer plots (e.g. geom_mosaic() + geom_mosaic_text()) no longer need the same argument repeated on every layer. An explicit layer argument, including expected = NULL, still overrides the plot-level setting.
  • Improved Pearson residual shading: negative residuals are now dark red and positive residuals dark blue, with matching dashed/solid cell outlines (disable via colour = NA, or override colour/linetype/linewidth directly). Added a custom residual legend with signed labels, observed extrema, supplied limits, reference values at -4/0/+4, endpoint colour squishing, and collision-aware ticks/labels, in both vertical and horizontal layouts.
  • Fixed mosaic spacing: offset is now the fixed gap at the deepest split, with gaps increasing by a factor of 1.5 toward outer splits (previously inconsistent), converted to local rectangle coordinates and safely constrained for very small cells; offset is validated as a single finite, non-negative value. **This changes spacing output relative to earlier versions.**
  • Fixed namespace-only use (haleyjeppson/ggmosaic#82): calls such as ggmosaic2::geom_mosaic() and ggmosaic2::product() now work without library(ggmosaic2).
  • Variables mapped only to fill or alpha (and colour in geom_mosaic_jitter()) remain available to the mosaic calculation and point aesthetics, but are no longer shown on the automatic product axes; only variables mapped through x or conds are labeled there (haleyjeppson/ggmosaic#39, haleyjeppson/ggmosaic#77). Variables can now be created within geom_mosaic(), and factors can be reordered for display.
  • theme_mosaic() now passes additional arguments through ... to ggplot2::theme().
  • Added the introducing-ggmosaic2 vignette.
  • Lightened the default geom_mosaic() tile fill (grey30 -> grey55).
  • Fixed inst/CITATION for the ggmosaic2 fork: retitled from ggmosaic, authors and year are now pulled from DESCRIPTION instead of hardcoded, and a broken multi-URL field is fixed.
  • Deprecated ggmosaic_app(), kept only for the historical record.
  • The introducing-ggmosaic2 vignette was edited for clarity and detail.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.5 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OKNow
  • OK5 OK2026-09-17
Advisories

none known

Documentation

In release 0.5.1
READMEYes · 1,031 wordsVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 0.5.1Citation fileYes · cites a publicationWebsiteYes · pkgdown
Cites an R Journal article
Help pages
33 (6 internal)includes a package overview page
Examples that run
94%17 run in a plain check · 1 never run
Exported functions with examples
75%
Documented parameters
99%
Return-value docs
100%
Help pages citing references
0%

Downloads

2.2K
CRAN downloads in the past year
Rank #4,092 · ~6/day · ~182/mo
Daily download trend is not available in this view yet.
2.1K30 days
2.2K90 days
2.2K1 year
Compare downloads with other packages →
Also on7 r2u6 autocran

Repository

2Stars
0Forks
1Open issues
0Open PRs
1Releases
219Commits
2Commit identities
categorical-datavisualization
219 commits · Last activity 2026-09-27
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
not measured
Median days to close, 50 most recently updated closed PRs
0

Commits over time

2026-09-20 · 2172026-10-04 · 219
PracticesBeta

11 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/friendly/ggmosaic2 on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-27 · The repository has a site deploy workflow

pkgdown site last built 2026-09-27

Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Show all practicesHide 2 practices
Lint, format, editor (1)
RStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-07-29
    Named in .Rbuildignore: .claude
    Commits: at least 23 crediting it in the message
Models named in its commits
  • Claude Sonnet 523 commits · Jul to Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing ggmosaic2 adds 67 packages (37 with compiled code, 64 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (2)
R >= 4.1.0ggplot2
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (6)
Author, Maintainer since 0.5.1 (2026), Copyright holder
Author
Contributor
Releases (1)
  • 0.5.1Latest
    2026-09-16 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-09-16
Total releases
1 / 1 yrs
License
GPL (>= 2) OSI
Minimum R
≥ 4.1.0
Bundled data
259 KB / 3 files
Download size
1.9 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("ggmosaic2")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for ggmosaic2 version 0.5.1 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy