Learn R Programming

sdcTable (version 0.10.3)

setInfo: set information of sdcProblem-class- or problemInstance-class objects

Description

Function getInfo is used to query information from sdcProblem-class- or problemInstance-class objects

Usage

setInfo(object, type, index, input)

Arguments

object
type
a character vector of length 1 specifying the the information that should be changed or modified, valid choices are:
  • lb: slot 'lb' of inputobjectif it is of class
index
numeric vector defining cell-indices for which which values in a specified slot should be changed|modified
input
numeric or character vector depending on argument type with its length matching the length of argument index
  • character vector if type matches 'sdcStatus'
  • a numeric vector if type matches 'lb', 'ub', 'L

Value

Examples

Run this code
# load primary suppressed data (as created in the example
of \code{\link{primarySuppression}})
sp <- searchpaths()
fn <- paste(sp[grep("sdcTable", sp)], "/data/problemWithSupps.RData", sep="")
problem <- get(load(fn))

# which is the overall total?
index.tot <- which.max(getInfo(problem, 'freq')
index.tot

# the anonymization state of the total is
print(getInfo(problem, type='sdcStatus')[index.tot])

# we want this cell to never be suppressed
problem <- setInfo(problem, type='sdcStatus', index=index.tot, input='z')

print(getInfo(problem, type='sdcStatus')[index.tot])

Run the code above in your browser using DataLab