Learn R Programming

sdcTable (version 0.6.4)

primarySuppression: primarySuppression

Description

primarySuppression() allows to modify an object created by createFullTable() to specfiy the cells that need to be protected by one of three popular primary suppression rules.

Usage

primarySuppression(outObj, suppRule_Freq=NULL, suppRule_P=NULL, suppRule_NK=NULL)

Arguments

outObj
an object created with createFullTable().
suppRule_Freq
a vector of length 2. the first element specifies the parameter 'n' of the n-rule meaning that all cells having less than n elements. if the second element of suppRule_Freq equals 0, then empty cells will not be considered primary unsafe.
suppRule_P
vector of length 1. the first element specifices parameter 'p' of the (p)-percent suppression rule.
suppRule_NK
vector of length 2. the first element specifices parameter 'n', the second element specifies parameter 'k' of the (n,k)-suppression rule.

Value

  • manipulated data.

Examples

Run this code
datObj <- get(load(paste(searchpaths()[grep("sdcTable", searchpaths())], "/data/testObj.RData", sep="")))

# all cells with less than 3 units should be primary unsafe
suppRule_Freq <- c(3, 0)
datObj1 <- primarySuppression(datObj, suppRule_Freq=suppRule_Freq)

# p-percent rule with p=80
suppRule_P 	<- 80
datObj1 <- primarySuppression(datObj, suppRule_P=suppRule_P)

Run the code above in your browser using DataLab