Learn R Programming

dimensio (version 0.9.0)

cdt: Complete Disjunctive Table

Description

Computes the complete disjunctive table of a factor table.

Usage

cdt(object, ...)

# S4 method for matrix cdt(object, exclude = NULL, abbrev = TRUE)

# S4 method for data.frame cdt(object, exclude = NULL, abbrev = TRUE)

Value

A data.frame.

Arguments

object

A data.frame.

...

Currently not used.

exclude

A vector of values to be excluded when forming the set of levels (see factor()). If NULL (the default), will make NA an extra level.

abbrev

A logical scalar: should the column names be abbreviated? If FALSE, these are of the form 'factor_level' but if abbrev = TRUE they are just 'level' which will suffice if the factors have distinct levels.

Author

N. Frerebeau

See Also

Other tools: burt()

Examples

Run this code
## Create a factor table
x <- data.frame(
  A = c("a", "b", "a"),
  B = c("x", "y", "z")
)

## Complete disjunctive table
cdt(x)

## Burt table
burt(x)

Run the code above in your browser using DataLab