vcd (version 0.9-9)

struc_mosaic: Core-generating Function for Mosaic Plots

Description

Core-generating function for strucplot returning a function producing mosaic plots.

Usage

struc_mosaic(zero_size = 0.5, zero_split = FALSE, zero_shade = TRUE,
             zero_gp = gpar(col = 0))

Arguments

zero_size
size of the bullets used for zero-entries in the contingency table (if 0, no bullets are drawn).
zero_split
logical controlling whether zero cells should be further splitted. If FALSE and zero_shade is FALSE, only one bullet is drawn (centered) for unsplitted zero cells. If FALSE and zero_sha
zero_shade
logical controlling whether zero bullets should be shaded.
zero_gp
object of class "gpar" used for zero bullets in case they are not shaded.

Value

  • A function with arguments:
  • residualstable of residuals.
  • observedtable of observed values.
  • expectednot used by struc_mosaic.
  • spacingobject of class "unit" specifying the space between the tiles.
  • gplist of gpar objects used for the drawing the tiles.
  • split_verticalvector of logicals indicating, for each dimension of the table, the split direction.

Details

This function is usually called by strucplot (typically when called by mosaic) and returns a function used by strucplot to produce mosaic plots.

References

Cohen, A. (1980), On the graphical display of the significant components in a two-way contingency table. Communications in Statistics---Theory and Methods, A9, 1025--1041.

Friendly, M. (1992), Graphical methods for categorical data. SAS User Group International Conference Proceedings, 17, 190--200. http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html

See Also

mosaic, strucplot, structable

Examples

Run this code
## Titanic data
data("Titanic")
## mosaic plot with large zeros
strucplot(Titanic, core = struc_mosaic(zero_size = 1))

Run the code above in your browser using DataLab