redacted_summary_catcat: Categorical by categorical cross-tabulation, with redaction...

View source: R/redaction.R

redacted_summary_catcatR Documentation

Categorical by categorical cross-tabulation, with redaction if necessary

Description

Categorical by categorical cross-tabulation, with redaction if necessary

Usage

redacted_summary_catcat(
  x1,
  x2,
  threshold = 5L,
  precision = 1L,
  .missing_name = "(missing)",
  .redacted_name = "redacted",
  .total_name = NULL
)

Arguments

x1

The first categorical variable.

x2

The second categoical variable.

threshold

The redaction threshold. All values less than or equal to this threshold will be redacted (and possibly more; see the redactor function)

precision

The precision of any rounding that is to be applied to frequency values. Defaults to 1 (no rounding).

.missing_name

The string used to replace NA categories.

.redacted_name

The string used to replace redacted values.

.total_name

The string used to the label the marginal totals. If NULL, no marginal totals are reported.

Details

This function takes two categorical vectors (or vectors that can be coerced to a categorical vectors), performs a cross-tabulation, and redacts according to the rules in redactor. proportions are based on x1 totals.

Value

A table of redacted frequencies and proportions, arranged in long-format.


wjchulme/osutils documentation built on Dec. 20, 2024, 9:56 a.m.