# loading test problem
p <- sdc_testproblem(with_supps = FALSE)
dt <- sdcProb2df(p, dimCodes = "original")
# question: which units contribute to cell region = "A" and gender = "female"?
# compute the id ("0102")
dt[region == "A" & gender == "female", strID]
# which indices contribute to the cell?
ids <- contributing_indices(prob = p, ids = "0101")
# check
dataObj <- get.sdcProblem(p, "dataObj")
rawData <- slot(dataObj, "rawData")
rawData[ids[["0101"]]]
# compute contributing ids for all cells
contributing_indices(p)
Run the code above in your browser using DataLab