# load example-problem with suppressions
# (same as example from ?primarySuppression)
p <- sdc_testproblem(with_supps = TRUE)
# which is the overall total?
idx <- which.max(getInfo(p, "freq")); idx
# we see that the cell with idx = 1 is the overall total and its
# anonymization state of the total can be extracted as follows:
print(getInfo(p, type = "sdcStatus")[idx])
# we want this cell to never be suppressed
p <- setInfo(p, type = "sdcStatus", index = idx, input = "z")
# we can verify this:
print(getInfo(p, type = "sdcStatus")[idx])
# changing slot 'UPL' for all cells
inp <- data.frame(
strID = getInfo(p, "strID"),
UPL_old = getInfo(p, "UPL")
)
inp$UPL_new <- inp$UPL_old + 1
p <- setInfo(p, type = "UPL", index = 1:nrow(inp), input = inp$UPL_new)
Run the code above in your browser using DataLab