CONtable: Function to compile a contingency table.

Description Usage Arguments Value Examples

View source: R/ContingencyTable.R

Description

Function to compile a contingency table.

Usage

1
2
CONtable(data, row.var, col.var, show.props = "cell",
  sign.digits.prop = 1, test.input = TRUE)

Arguments

data

A data frame that contains the data.

row.var

A factor with factor levels defining the rows of the contingency table.

col.var

A factor with factor levels defining the columns of the contingency table.

show.props

Which proportions for cell counts to show.

  • If show.props = "none", no proportions are shown;

  • if show.props = "cell", proportions are relative to total;

  • if show.props = "row", proportion is relative to row-totals (no proportions of the column totals are shown to facilitate reading of the table);

  • if show.props = "col", proportion is relative to column-totals (no proportions of the row totals are shown to facilitate reading of the table).

sign.digits.prop

Number of digits for the displayed proportion of cell counts.

test.input

Whether the input is tested for logical consistency. Warning: testing is not comprehensive. Setting test.input = FALSE will bypass logical tests.

Value

An R character-matrix containing the compiled contingency table information.

Examples

1
CONtable(example_data, row.var = "Educ", col.var = "Gender", show.props = "row", sign.digits.prop=1)

FrThomas/risyphus documentation built on Dec. 6, 2019, 6:27 a.m.