Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

co_table

Compute Conditional Tables


Description

For a contingency table in array form, compute a list of conditional tables given some margins.

Usage

co_table(x, margin, collapse = ".")

Arguments

x

a contingency table in array form.

margin

margin index(es) or corresponding name(s) of the conditioning variables.

collapse

character used when collapsing level names (if more than 1 margin is specified).

Details

This is essentially an interface to [ which is more convenient for arrays of arbitrary dimension.

Value

A list of the resulting conditional tables.

Author(s)

Examples

data("HairEyeColor")
co_table(HairEyeColor, 1)
co_table(HairEyeColor, c("Hair", "Eye"))
co_table(HairEyeColor, 1:2, collapse = "")

vcd

Visualizing Categorical Data

v1.4-10
GPL-2
Authors
David Meyer [aut, cre], Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Kurt Hornik [aut], Florian Gerber [ctb], Michael Friendly [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.