The number of contributors is the number unique contributing 'charVar' codes.
Usage
NContributorsRule(
data,
freq,
numVar,
x,
maxN = 3,
protectZeros = FALSE,
charVar = NULL,
removeCodes = character(0),
remove0 = TRUE,
...
)
Arguments
- data
Input data as a data frame
- freq
Vector of aggregate frequencies
- numVar
Numerical variables. When several variables, only first is used.
- x
Model matrix generated by parent function
- maxN
Primary suppression when number of contributors
<= maxN
.- protectZeros
Suppression parameter. Only TRUE (default) is used implemented.
- charVar
Variable(s) with contributor codes. When empty, unique contributor in each row is assumed. When several variables, see details.
- removeCodes
Vector of codes to be omitted when counting contributors. With empty
charVar
row indices are assumed and conversion to integer is performed.- remove0
When set to
TRUE
(default), data rows in which the firstnumVar
(if any) is zero are excluded from the count of contributors. Alternatively,remove0
can be specified as one or more variable names. In this case, all data rows with a zero in any of the specified variables are omitted from the contributor count. Specifyingremove0
as variable name(s) is useful for avoiding warning when there are multiplenumVar
variables.- ...
unused parameters
Value
List where first element is logical vector defining primary suppressions.
The second element is data frame where nRule
is number contributors used
in rule and where nAll
is similar, but without omitting codes in removeCodes
.
Details
When several charVar
variables, the rule is applied independently to each variable.
Primary suppression in at least one case results in primary suppression in the output.
It is possible to specify maxN
and removeCodes
independently for each charVar
by using a
named list as input with charVar
as names. E.g. maxN = list(char1 = 3, char2 = 2)
.