plot.mosaic_analysis: Plot method for mosaic_analysis objects

View source: R/mosaic_analysis.R

plot.mosaic_analysisR Documentation

Plot method for mosaic_analysis objects

Description

Re-renders the flat mosaic from the stored contingency table and residuals, so styling can be changed without re-running the test. Any flat-mosaic styling argument (tile_label, pct_base, col_label_side, legend_size, ...) may be overridden via ....

Usage

## S3 method for class 'mosaic_analysis'
plot(x, ...)

Arguments

x

A mosaic_analysis object.

...

Styling overrides forwarded to the flat renderer.

Value

The ggplot object, invisibly (drawn as a side effect).

Examples

df <- data.frame(
  a = sample(c("X", "Y", "Z"), 200, replace = TRUE),
  b = sample(c("P", "Q"), 200, replace = TRUE)
)
res <- mosaic_analysis(df, "a", "b", min_count = 5)

plot(res, tile_label = "percent", legend_position = "bottom")


Nestimate documentation built on July 11, 2026, 1:09 a.m.