bookplot | R Documentation |
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.
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
)
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 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.