MosaicPlot | R Documentation |
Plot a mosaic plot custom built for a particular figure.
MosaicPlot(
formula,
data,
col = "#00000022",
border = 1,
dir = c("v", "h"),
off = 0.01,
cex.axis = 0.7,
col.dir = "v",
flip = c("v"),
...
)
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 ( |
... |
Ignored. |
David Diez
data(email)
data(COL)
email$spam <- ifelse(email$spam == 0, "not\nspam", "spam")
MosaicPlot(number ~ spam, email, col = COL[1:3], off = 0.02)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.