# define an example problem with two hierarchies
p <- sdc_testproblem(with_supps = FALSE)
# apply primary suppression
p <- primarySuppression(p, type = "freq", maxN = 3)
# `p` is an `sdcProblem` object
print(class(p))
for (slot in c("lb", "ub", "LPL", "SPL", "UPL", "sdcStatus",
"freq", "strID", "numVars", "w")) {
message("slot: ", shQuote(slot))
print(getInfo(p, type = slot))
}
# protect the cell and extract results
p_protected <- protectTable(p, method = "SIMPLEHEURISTIC")
for (slot in c("finalData", "nrNonDuplicatedCells", "nrPrimSupps",
"nrSecondSupps", "nrPublishableCells", "suppMethod")) {
message("slot: ", shQuote(slot))
print(getInfo(p_protected, type = slot))
}
Run the code above in your browser using DataLab