redactor2: Redact values in a vector based on frequency values

View source: R/redaction.R

redactor2R Documentation

Redact values in a vector based on frequency values

Description

Redact values in a vector based on frequency values

Usage

redactor2(n, threshold, x = NULL)

Arguments

n

A vector of integer frequencies or counts from a 1-dimension frequency distribution.

threshold

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

x

Values to redact. If x is NULL then x redacts values of n.

Details

If x is NULL, then this function redacts values in n and returns the redacted vector. If x is not NULL, values in x are redacted according to frequencies in n. Values are redacted as follows: all frequencies less than or equal to the threshold are redacted; if the sum the redacted frequencies is also less than or equal to the threshold, then the smallest unredacted frequency is also redacted.

Value

A vector the same length as n.


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