bookplot: bookplot

View source: R/bookplot.R

bookplotR Documentation

bookplot

Description

Similar to graphics::spineplot, a bookplot visualizes the contingency table of two categorical variables (factors). The width of each stack is scaled to the square root of the marginal total, and the height of each is scaled such that the area of each rectangle in the stack is proportional to the corresponding count.

Usage

bookplot(
  x,
  y = NA,
  space = 1,
  edges = T,
  border = NA,
  col = NA,
  lwd = 1,
  xaxt = "s",
  axis.srt = 90,
  axis.offset = 0.05,
  cex.axis = 1,
  edge.col = "grey",
  edge.lwd = 0.5,
  legend = NA
)

Arguments

x:

factor, independent variable

y:

factor, dependent variable

space:

amount of space between stacked bars

edges:

if TRUE, draw line segments connecting adjacent rectangles of the same variable.

border:

colour for rectangle borders; defaults to NA (no border)

col:

colour(s) to fill rectangles


ArtPoon/ggfree documentation built on July 11, 2024, 11:15 a.m.