PlotMosaic | R Documentation |
Plots a mosaic on the current graphics device.
PlotMosaic(x, main = deparse(substitute(x)), horiz = TRUE, cols = NULL,
off = 0.02, mar = NULL, xlab = NULL, ylab = NULL,
cex = par("cex"), las = 2, ...)
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. |
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). |
cex |
numeric character expansion factor; multiplied by |
las |
the style of axis labels. 0 - parallel to the axis, 1 - horizontal, 2 - perpendicular, 3 - vertical. |
... |
additional arguments are passed to the text function. |
The reason for this function to exist are the unsatisfying labels in base mosaicplot.
list with the midpoints of the rectangles
Andri Signorell <andri@signorell.net>
Friendly, M. (1994) Mosaic displays for multi-way contingency tables. Journal of the American Statistical Association, 89, 190-200.
mosaicplot
PlotMosaic(HairEyeColor[,,1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.