Package: ggmosaic2 0.5.1

Michael Friendly

ggmosaic2: Mosaic Plots in the 'ggplot2' Framework, Extended

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.

Authors:Michael Friendly [aut, cre, cph], Gavin Klorfine [aut], Haley Jeppson [aut], Heike Hofmann [aut], Di Cook [aut], Hadley Wickham [ctb]

ggmosaic2_0.5.1.tar.gz
ggmosaic2_0.5.1.zip(r-4.7-any)ggmosaic2_0.5.1.zip(r-4.6-any)
ggmosaic2_0.5.1.tar.gz(r-4.7-any)ggmosaic2_0.5.1.tar.gz(r-4.6-any)
ggmosaic2_0.5.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
ggmosaic2/json (API)

# Install 'ggmosaic2' in R:
install.packages('ggmosaic2', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/friendly/ggmosaic2/issues

Pkgdown/docs site:https://friendly.github.io

Datasets:
  • fly - Flying Etiquette Survey Data
  • happy - Data related to happiness from the general social survey.
  • titanic - Passengers and crew on board the Titanic

On CRAN:

Conda:

3.30 score 30 exports 67 dependencies

Last updated from:489628e9d0. Checks:6 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK192
source / vignettesOK285
linux-releaseOK207
windows-develOK131
windows-releaseOK154
wasm-releaseOK160

Exports:ddeckerfacet_mosaic_gridgeom_mosaicgeom_mosaic_jittergeom_mosaic_textGeomMosaicGeomMosaicJitterGeomMosaicTextggmosaic_apphbarhspinemosaicmosaic_settingsprodcalcproductscale_fill_residualscale_fill_residualsscale_x_productlistscale_y_productlistScaleContinuousProductspinestat_mosaicstat_mosaic_jitterstat_mosaic_textStatMosaicStatMosaicJitterStatMosaicTexttheme_mosaicvbarvspine

Dependencies:askpassbase64encbslibcachemclicpp11crosstalkcurldata.tabledigestdplyrevaluatefarverfastmapfontawesomefsgenericsggplot2ggrepelgluegtablehighrhtmltoolshtmlwidgetshttrisobandjquerylibjsonliteknitrlabelinglaterlazyevallifecyclemagrittrmemoisemimeopensslotelpillarpkgconfigplotlyplyrproductplotspromisespurrrR6rappdirsRColorBrewerRcpprlangrmarkdownS7sassscalesstringistringrsystibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunyaml

ggmosaic and Loglinear Models
Introduction | Basic Example: Independence Model | Simple Mosaic Plot (No Model) | Extended Mosaic Plot with Residual Shading | Model Specification | 1. Shortcut Strings | 2. Custom Formulas | 3. Conditional Independence | Interpreting Residuals | What Do Residuals Mean? | Three-Way Tables | Labeling Cells with Values | Display Observed Counts | Display Residuals | Display Expected Frequencies | The Four Display Options | Customizing the Color Scale | Text Aesthetics | Complete Example: Comparing Models | References | Session Info

Last update: 2026-09-16
Started: 2026-09-16

Introducing ggmosaic2: an enhanced ggmosaic
Basic Appearance | Utilizing the top and right axes | theme_mosaic() | Spacing of cells | Faceting is Fixed | Residual-Based Shading | Sharing settings between mosaic layers | Other fixes/changes | References

Last update: 2026-09-16
Started: 2026-09-16

Mosaic plots with ggplot2
How to use ggmosaic | Examples | One variable | Two variables | Conditioning | Alternative to conditioning: faceting | The importance of ordering | Other features of geom_mosaic() | Divider function: Types of partitioning | Partitioning with one or more variables | Adjusting the offset | Version compatibility issues with ggplot2

Last update: 2026-09-16
Started: 2026-09-16

Three Forms of Frequency Tables for Mosaic Displays
Introduction | The Three Forms | Table Form | Frequency Form | Case Form | Converting Between Forms | Examples | Using Each Form with geom_mosaic() | Working with the Three-Way Table: Hair × Eye × Sex | Using Conditioning Variables | Default Shading vs. Residual-Based Shading | Default Shading | Residual-Based Shading | Independence Model for Two-Way Table | Adding Cell Values | Independence Model for Three-Way Table | Custom Models | Comparing Observed and Expected | Summary | Key Takeaways | Recommendations | References | Session Info

Last update: 2026-09-16
Started: 2026-09-16