Learn R Programming

sdcTable (version 0.29)

getInfo: query information from objects

Description

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

Usage

getInfo(object, type)

Arguments

object
type

a character vector of length 1 specifying the information which should be returned.

Value

manipulated data dependend on arguments object and type

Examples

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

# problem is an object of class \code{\link{sdcProblem-class}}
print(class(problem))

for (slot in c('lb','ub','LPL','SPL','UPL','sdcStatus',
  'freq', 'strID', 'numVars', 'w')) {
  cat('slot', slot,':\n')
  print(getInfo(problem, type=slot))
}

# extracting information for objects of class \code{\link{safeObj-class}}
fn <- paste(sp[grep("sdcTable", sp)], "/data/protectedData.RData", sep="")
protectedData <- get(load(fn))
for (slot in c('finalData', 'nrNonDuplicatedCells', 'nrPrimSupps',
  'nrSecondSupps', 'nrPublishableCells', 'suppMethod')) {
  cat('slot', slot,':\n')
  print(getInfo(protectedData, type=slot))
}
# }

Run the code above in your browser using DataLab