bp3d: A barplot for 3 dimensional contingency tables

View source: R/bp3d.R

bp3dR Documentation

A barplot for 3 dimensional contingency tables

Description

draws the conditioned freuqencies of a categorial variable on two further categorial variables

Usage

bp3d(
  x,
  z,
  y,
  main = "",
  ylab = "frequencies",
  xlab = "",
  col = heat.colors(length(levels(y)) + 2)[1:length(levels(y))],
  space = 0.1,
  factor_space = 3,
  left_space = 0,
  box = T,
  boxcol = c("white", "grey"),
  legend = TRUE,
  locator = "topright"
)

Arguments

x

main categorical variable on x-axis

z

categorical sub variable on x axis

y

dependend categorical variable

main

title

ylab

y axis label

xlab

x axis label

col

colors of bar segments

space

space between bars within groups

factor_space

factor of space between groups

left_space

left space of bars

box

draw boxes behind goups of x

boxcol

color of boxes behind groups

legend

draw legend

locator

location of legend: "topright", "right" "bottomright"

Examples

x <- sample(paste("time",1:4),240,T)
z <- rep(c("A","B"),each=120)
y <- paste("answer",sample(1:7,240,T))
bp3d(x,z,y,main="bp3d()",xlab="treatment group")

ingmarboeschen/graphing documentation built on Jan. 14, 2025, 7:32 a.m.