Description Usage Arguments Value Examples
create required input-files and batch-file for tau-argus given an sdcProblem-obj
object
1 2 3 4 |
obj |
an object of class |
typ |
(character) either |
verbose |
(logical) if TRUE, the contents of the batch-file are written to the prompt |
path |
path, into which (temporary) files will be written to (amongst them being the batch-files). Each file written to this folder belonging to the same problem contains a random id in its filename. |
solver |
which solver should be used. allowed choices are
In case "CPLEX" is used, it is also mandatory to specify argument 'licensefile' which needs to be the absolute path the the cplex license file |
method |
secondary cell suppression algorithm, possible choices include:
|
primSuppRules |
rules for primary suppression, provided as a
|
responsevar |
which variable should be tabulated (defaults to frequencies). For details see tau-argus manual section 4.4.4. |
shadowvar |
if specified, this variable is used to apply the safety rules, defaults to |
costvar |
if specified, this variable describes the costs of suppressing each individual cell. For details see tau-argus manual section 4.4.4. |
requestvar |
if specified, this variable (0/1-coded) contains information about records that request protection. Records with 1 will be protected in case a corresponding request rule matches. It is ignored, if tabular input is used. |
holdingvar |
if specified, this variable contains information about records that should be grouped together. It is ignored, if tabular input is used. |
... |
allows to specify additional parameters for selected suppression-method as described above
as well as |
the filepath to the batch-file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # loading micro data from sdcTable
data("microData1", package="sdcTable")
microData1$num1 <- rnorm(mean=100, sd=25, nrow(microData1))
microData1$num2 <- round(rnorm(mean=500, sd=125, nrow(microData1)),2)
microData1$weight <- sample(10:100, nrow(microData1), replace=TRUE)
dim.region <- data.frame(
levels=c('@','@@','@@','@@','@@'),
codes=c('Total', 'A','B','C','D'),
stringsAsFactors=FALSE)
dim.region_dupl <- data.frame(
levels=c('@','@@','@@','@@@','@@','@@','@@@'),
codes=c('Total', 'A','B','b1','C','D','d1'),
stringsAsFactors=FALSE)
dim.gender <- data.frame(
levels=c('@','@@','@@'),
codes=c('Total', 'male','female'),
stringsAsFactors=FALSE)
dimList <- list(region=dim.region, gender=dim.gender)
dimList_dupl <- list(region=dim.region_dupl, gender=dim.gender)
dimVarInd <- c(1,2)
numVarInd <- 3:5
sampWeightInd <- 6
freqVarInd <- weightInd <- NULL
# creating an object of class \code{\link{sdcProblem-class}}
obj <- makeProblem(
data=microData1,
dimList=dimList,
dimVarInd=dimVarInd,
freqVarInd=freqVarInd,
numVarInd=numVarInd,
weightInd=weightInd,
sampWeightInd=sampWeightInd)
# creating an object of class \code{\link{sdcProblem-class}} containing "duplicated" codes
obj_dupl <- makeProblem(
data=microData1,
dimList=dimList_dupl,
dimVarInd=dimVarInd,
freqVarInd=freqVarInd,
numVarInd=numVarInd,
weightInd=weightInd,
sampWeightInd=sampWeightInd)
## create primary suppression rules
primSuppRules <- list()
primSuppRules[[1]] <- list(type="freq", n=5, rg=20)
primSuppRules[[2]] <- list(type="p", n=5, p=20)
# other supported formats are:
# list(type="nk", n=5, k=20)
# list(type="zero", rg=5)
# list(type="mis", val=1)
# list(type="wgt", val=1)
# list(type="man", val=20)
## create batchInput object
bO_md1 <- createArgusInput(obj, typ="microdata", path=getwd(), solver="FREE", method="OPT",
primSuppRules=primSuppRules, responsevar="num1")
bO_td1 <- createArgusInput(obj, typ="tabular", path=getwd(), solver="FREE", method="OPT")
bO_td2 <- createArgusInput(obj_dupl, typ="tabular", path=getwd(), solver="FREE", method="OPT")
## Not run:
## in case CPLEX should be used, it is required to specify argument licensefile
bO_md2 <- createArgusInput(obj, typ="microdata", path=getwd(), solver="CPLEX", method="OPT",
primSuppRules=primSuppRules, responsevar="num1", licensefile="/path/to/my/cplexlicense")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.