DescTools (version 0.99.14)

PlotMosaic: Mosaic Plots

Description

Plots a mosaic on the current graphics device.

Usage

PlotMosaic(x, main = deparse(substitute(x)), horiz = TRUE, cols = NULL,
           off = 0.02, mar = NULL, xlab = NULL, ylab = NULL)

Arguments

x
a contingency table in array form, with optional category labels specified in the dimnames(x) attribute. The table is best created by the table() command. So far only 2-way tables are allowed.
main
character string for the mosaic title.
horiz
logical, defining the orientation of the mosaicplot. TRUE (default) makes a horizontal plot.
cols
the colors of the plot.
off
the offset between the rectangles. Default is 0.02.
mar
the margin for the plot.
xlab, ylab
x- and y-axis labels used for the plot; by default, the first and second element of names(dimnames(X)) (i.e., the name of the first and second variable in X).

Value

  • list with the midpoints of the rectangles

Details

The reason for this function to exist are the unsatisfying labels in base mosaicplot.

References

Friendly, M. (1994) Mosaic displays for multi-way contingency tables. Journal of the American Statistical Association, 89, 190-200.

See Also

mosaicplot

Examples

Run this code
PlotMosaic(HairEyeColor[,,1])

Run the code above in your browser using DataLab