Call Tau-Argus to protect a 4 or 5 dimensions table by splitting it in several 3 dimensions table.
Source:R/sp_tab_rtauargus.R
tab_rtauargus4.Rd
Usage
tab_rtauargus4(
tabular,
explanatory_vars,
dir_name,
secret_var,
totcode,
files_name = NULL,
hrc = NULL,
secret_no_pl = NULL,
cost_var = NULL,
value = "value",
freq = "freq",
ip = 10,
suppress = "MOD(1,5,1,0,0)",
safety_rules = paste0("MAN(", ip, ")"),
nb_tab_option = "smart",
limit = 14700L,
dfs_name = "tab",
...
)
Arguments
- tabular
data.frame which contains the tabulated data and an additional boolean variable that indicates the primary secret of type boolean
( data.frame contenant les données tabulées et une variable supplémentaire indiquant le secret primaire de type booléen.)- explanatory_vars
Vector of explanatory variables
Variables catégorielles, sous forme de vecteurs
Example :c("A21", "TREFF", "REG")
for a table crossingA21
xTREFF
xREG
(Variable indiquant le secret primaire de type booléen: prend la valeur "TRUE" quand les cellules du tableau doivent être masquées par le secret primaire, "FALSE" sinon. Permet de créer un fichier d'apriori)- dir_name
string indicated the path of the directory in which to save all the files (.rda, .hst, .txt, .arb, .csv) generated by the function.
- secret_var
Nae of the boolean variable which specifies the secret, primary or not : equal to "TRUE" if a cell is concerned by the secret,"FALSE" otherwise. will be exported in the apriori file.
(Variable indiquant le secret de type booléen: prend la valeur "TRUE" quand les cellules du tableau doivent être masquées "FALSE" sinon. Permet de créer un fichier d'apriori)- totcode
Code(s) which represent the total of a categorical variable (see section 'Specific parameters' for this parameter's syntax). If unspecified for a variable(neither by default nor explicitly) it will be set to
rtauargus.totcode
.
(Code(s) pour le total d'une variable catégorielle (voir section 'Specific parameters' pour la syntaxe de ce paramètre). Les variables non spécifiées (ni par défaut, ni explicitement) se verront attribuer la valeur dertauargus.totcode
.)- files_name
string used to name all the files needed to process. All files will have the same name, only their extension will be different.
- hrc
Informations of hierarchical variables (see section 'Hierarchical variables').
(Informations sur les variables hiérarchiques (voir section 'Hierarchical variables').) (Caractère qui, répété n fois, indique que la valeur est à n niveaux de profondeur dans la hiérarchie.)- secret_no_pl
name of a boolean variable which indicates the cells on which the protection levels won't be applied. If
secret_no_pl = NULL
(default), the protection levels are applied on each cell which gets aTRUE
status for thesecret_var
.- cost_var
Numeric variable allow to change the cost suppression of a cell for secondary suppression, it's the value of the cell by default, can be specified for each cell, fill with NA if the cost doesn't need to be changed for all cells
(Variable numeric qui permet de changer la coût de suppression d'une cellule, pris en compte dans les algorithmes de secret secondaire.Par défaut le coût correspond à la valeur de la cellule. peut être spécifié pour chacune des cellules, peut contenir des NA pour les coûts que l'on ne souhaite pas modifier.) (nombre minimal de décimales à afficher (voir section 'Number of decimals').)- value
Name of the column containing the value of the cells.
(Nom de la colonne contenant la valeur des cellules)- freq
Name of the column containing the cell frequency.
(Nom de la colonne contenant les effectifs pour une cellule)- ip
Value of the safety margin in % (must be an integer). (Valeur pour les intervalles de protection en %, doit être entier )
- suppress
Algortihm for secondary suppression (Tau-Argus batch syntax), and the parameters for it.
( Algorithme de gestion du secret secondaire (syntaxe batch de Tau-Argus), ainsi que les potentiels paramètres associés)- safety_rules
Rules for primary suppression with Argus syntax, if the primary suppression has been dealt with an apriori file specify manual safety range :"MAN(10)" for example.
( Règle(s) de secret primaire. Chaîne de caractères en syntaxe batch Tau-Argus. Si le secret primaire a été traité dans un fichier d'apriori : utiliser "MAN(10)")- nb_tab_option
strategy to follow for choosing variables automatically:
'min'
: minimize the number of tables;'max'
: maximize the number of tables;'smart'
: minimize the number of tables under the constraint of their row count.
- limit
numeric, used to choose which variable to merge (if nb_tab_option = 'smart') and split table with a number of row above this limit in order to avoid tauargus failures
- dfs_name
name used to write hrc files when reducing dims
- ...
additional parameters#'
Value
The original tabular is returned with additional variables indicating whether or not the cell has to be masked according to Tau-Argus
Examples
if (FALSE) {
#Please don't forget to specify the localisation of Tau-Argus in your computer
options(
rtauargus.tauargus_exe =
"Y:/Logiciels/TauArgus/TauArgus4.2.3/TauArgus.exe"
)
data(datatest1)
expl_vars <- c("A10", "treff","type_distrib","cj")
res_dim4 <- tab_rtauargus4(
tabular = datatest1,
files_name = "datatest1",
dir_name = "tauargus_files",
explanatory_vars = expl_vars,
totcode = setNames(rep("Total", 4), expl_vars),
secret_var = "is_secret_prim",
value = "pizzas_tot_abs",
freq = "nb_obs_rnd",
verbose = TRUE,
nb_tab_option = "min",
verbose = TRUE
)
# With a data of 5 variables
data(datatest2)
expl_vars <- c("A10", "treff","type_distrib","cj","nuts1")
res_dim5 <- tab_rtauargus4(
tabular = datatest2,
files_name = "datatest2",
dir_name = "tauargus_files",
explanatory_vars = expl_vars,
totcode = setNames(rep("Total", 5), expl_vars),
secret_var = "is_secret_prim",
value = "pizzas_tot_abs",
freq = "nb_obs_rnd",
verbose = TRUE,
nb_tab_option = "min", # split into the minimum of tables.
verbose = TRUE,
suppress = "GH(1,100)" # We use hypercube to save time.
)
}