redacted_summary_cat: Summarise a categorical variable and redact if necessary

View source: R/redaction.R

redacted_summary_catR Documentation

Summarise a categorical variable and redact if necessary

Description

Summarise a categorical variable and redact if necessary

Usage

redacted_summary_cat(
  x,
  threshold = 5L,
  precision = 1L,
  .missing_name = "(missing)",
  .redacted_name = "redacted"
)

Arguments

x

The vector to summarise and redact.

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.

Details

This function takes a categorical vector (or something that can be coerced to a categorical vector), computes value frequencies and proportions, and redacts according to the rules in redactor.

Value

A table of redacted frequencies and proportions.


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