MosaicPlot: Custom Mosaic Plot

View source: R/MosaicPlot.R

MosaicPlotR Documentation

Custom Mosaic Plot

Description

Plot a mosaic plot custom built for a particular figure.

Usage

MosaicPlot(
  formula,
  data,
  col = "#00000022",
  border = 1,
  dir = c("v", "h"),
  off = 0.01,
  cex.axis = 0.7,
  col.dir = "v",
  flip = c("v"),
  ...
)

Arguments

formula

Formula describing the variable relationship.

data

Data frame for the variables, optional.

col

Colors for plotting.

border

Ignored.

dir

Ignored.

off

Fraction of white space between each box in the plot.

cex.axis

Axis label size.

col.dir

Direction to lay out colors.

flip

Whether to flip the ordering of the vertical ("v") and/or horizontal ("h") ordering in the plot.

...

Ignored.

Author(s)

David Diez

Examples


data(email)
data(COL)
email$spam <- ifelse(email$spam == 0, "not\nspam", "spam")
MosaicPlot(number ~ spam, email, col = COL[1:3], off = 0.02)

openintro documentation built on June 22, 2024, 7:37 p.m.