Learn R Programming

sdcTable (version 0.6.4)

cellInfo: cellInfo

Description

cellInfo() calculates the anonymity state of a given cell.

Usage

cellInfo(outObj, characteristics, varNames, return=FALSE)

Arguments

outObj
a data-object derived from primarySuppression (of class 'outObj') or protectTable (of class 'safeTable')
characteristics
for each dimensional variable a given characteristic. It is important that the characteristics are in the same order as specified in input object 'varNames'
varNames
vector of variable names of the dimensional variables which needs to be of exact same length as the number of dimensional variables and the length of input object 'characteristics'.
return
if set to TRUE, an object containing the information calculated is returned, else the information is only printed

Value

  • manipulated data.

Details

if return is set to TRUE, a list-object is returned which containes interesting anonymity-information about the selected table cell. if return is set to FALSE, this information is only printed to the screen.

Examples

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

# check state of some cells...
a <- cellInfo(protectedData, c("011","B","Kb","w"), c("V1", "V3", "V4", "V2"), return=TRUE) 
b <- cellInfo(protectedData, c("011","w","B","Kb"), c("V1", "V2", "V3", "V4"), return=TRUE) 

str(a$problematicPrimaryCells)
str(b$problematicPrimaryCells)

# publishable cell
cellInfo(protectedData, c("A","013","Ac","w"), c("V3", "V1", "V4", "V2"), return=FALSE) 
# a primary suppressed cell
cellInfo(protectedData, c("Aa","m","A","011"), c("V4", "V2", "V3", "V1"), return=FALSE) 

# a secondary suppressed cell
cellInfo(protectedData, c("Ac","m","A","021"), c("V4", "V2", "V3", "V1"), return=FALSE)

Run the code above in your browser using DataLab