mplot3_mosaic: Mosaic plot

View source: R/mplot3_mosaic.R

mplot3_mosaicR Documentation

Mosaic plot

Description

Plots a mosaic plot using graphics::mosaicplot

Usage

mplot3_mosaic(
  x,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  border = FALSE,
  theme = rtTheme,
  theme.args = list(),
  palette = rtPalette,
  mar = NULL,
  oma = rep(0, 4),
  par.reset = TRUE,
  new = FALSE,
  autolabel = letters,
  filename = NULL,
  pdf.width = 5,
  pdf.height = 5,
  ...
)

Arguments

x

contingency table, e.g. output of table()

main

Character: Main title

xlab

Character: x-axis label

ylab

Character: y-axis label

border

Color vector for cell borders or FALSE to turn off. Default = FALSE

theme

Character: Run themes() for available themes

theme.args

List of arguments to pass to theme. Optional, same args can be passed to theme function

palette

Vector of colors, or Character defining a builtin palette - get options with rtpalette()

new

Logical: If TRUE, add plot to existing plot. See par("new")

filename

Character: Path to file to save plot. Default = NULL

pdf.width

Float: Width in inches for PDF output, if filename is defined

pdf.height

Float: Height in inches for PDF output, if filename is defined

Author(s)

E.D. Gennatas

Examples

## Not run: 
party <- as.table(rbind(c(762, 327, 468), c(484, 239, 477)))
dimnames(party) <- list(gender = c("F", "M"),
                        party = c("Democrat","Independent", "Republican"))
mplot3_mosaic(party)

## End(Not run)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.