plot_table {FunChisq}R Documentation

Plot a Contingency Table

Description

The input table is visualized as matrix by shades of a given color for better understanding of the underlying pattern. The values in the table must be real. Thus non-integers or negative numbers are acceptable.

Usage

plot_table(table, xlab = "Column", ylab = "Row", col = "green3",
           xaxt = "n", yaxt = "n", main = NULL,
           show.value = TRUE, value.cex = 2,
           highlight=c("row.maxima", "none"),
           highlight.col=col,
           mgp=c(0.5,0,0), mar=c(2,2,3,1.5), ...)

Arguments

table

A data frame or a matrix.

xlab

The lable of the horizontal axis.

ylab

The lable of the vertical axis.

col

The color corresponding to the maximum value in the table.

xaxt

The style of the horizontal axis. See par.

yaxt

The style of the vertical axis. See par.

main

The title of the plot.

show.value

logical. Show the value of each cell in the table on the plot.

value.cex

Relative magnification factor if values are to be put in the cell.

...

Parameters acceptable to image function in the graphics package.

highlight

Specify to highlight row maxima or no highlight. When highlighted, a box is placed around each row maximum.

highlight.col

The color used to highlight a cell in the table.

mgp

The margin (in mex units) for the axis title, labels and line. See par.

mar

The margins of the four sides of the plot. See par.

Author(s)

Joe Song

Examples

opar <- par(mfrow=c(2,2))
plot_table(matrix(1:6, nrow=2), col="seagreen2")

plot_table(matrix(rnorm(20), nrow=5), col="orange", show.value=FALSE)

plot_table(matrix(rpois(16, 2), nrow=4), col="cornflowerblue", highlight="none")

plot_table(matrix(rbinom(15, 8, 0.5), nrow=3), col="sienna2", highlight="none")
par(opar)

[Package FunChisq version 2.4.8-1 Index]