Closed jnlb closed 1 week ago
The problem is that the parameter name maxN
is the same in two functions with different meanings. So another workaround is to change one of them.
PrimaryDefault_ <- function(maxN_ = 3, maxN, ...) {
PrimaryDefault(maxN = maxN_, ...)
}
GaussSuppressionFromData(
data = dataset,
numVar = "value",
freqVarNew = "freq",
dimVar = c("sector4", "geo"),
charVar = "company",
maxN_ = 1,
maxN = 0,
primary = c(PrimaryDefault_, NContributorsRule),
protectZeros = FALSE,
preAggregate = TRUE,
singletonMethod = "none"
)
But since that's the case (same parameter name), I agree that there should be a change that avoids the workaround. Thank you.
The improvement is now available in the latest CRAN release.
I believe it should now work as intended.
See NEWS.
I have now familiarised myself with the CRAN release and checked that the new feature works as I had hoped. Thank you for the very fast reaction!
Since no issue is left to address here, I will close this one with this comment.
This issue is regarding the
GaussSuppressionFromData
function.A typical cell suppression case may include applying primary suppressions via the frequency rule for both statistical units and with regard to some contributor ID (
contributorVar
orcharVar
). Sometimes the thresholdmaxN
will differ for these respective rules. Examples from the documentation suggest supplying themaxN
parameter as a named list, e.g.maxN = list(charVar1 = 3, charVar2 = 5)
.The problem is that when used in tandem with NContributors, the normal frequency rule may not be registered. This is not a big issue, since a custom frequency check is extremely easy to program, but it is still a bug that should be looked into. Especially since the suppression pattern behaves in an extremely odd way. Here is a minimal example:
The above code outputs the following suppression pattern:
This is clearly not correct, just look at the rows with frequency 1.
Here is what happens when you set maxN = 1 for frequencies.
In short, the expected behaviour should be what this following function call outputs.
Tested on an environment with:
I have made no progress so far on figuring out what causes this issue.