View source: R/tab_rtauargus.R
tab_rtauargus2 | R Documentation |
tab_multi_manager
function.Wrapper of tab_rtauargus adapted for tab_multi_manager
function.
tab_rtauargus2(
tabular,
files_name = NULL,
dir_name = NULL,
explanatory_vars,
totcode,
hrc = NULL,
secret_var = NULL,
secret_no_pl = NULL,
cost_var = NULL,
value = "value",
freq = "freq",
ip = 10,
suppress = "MOD(1,5,1,0,0)",
split_tab = TRUE,
nb_tab_option = "smart",
limit = 14700,
...
)
The original tabular is returned with a new column called Status, indicating the status of the cell coming from Tau-Argus : "A" for a primary secret due to frequency rule, "B" for a primary secret due to dominance rule, "D" for secondary secret and "V" for no secret cell.
tab_rtauargus
## Not run:
library(dplyr)
data(turnover_act_size)
# Prepare data with primary secret ----
turnover_act_size <- turnover_act_size %>%
mutate(
is_secret_freq = N_OBS > 0 & N_OBS < 3,
is_secret_dom = ifelse(MAX == 0, FALSE, MAX/TOT>0.85),
is_secret_prim = is_secret_freq | is_secret_dom
)
# Make hrc file of business sectors ----
data(activity_corr_table)
hrc_file_activity <- activity_corr_table %>%
write_hrc2(file_name = "hrc/activity")
# Compute the secondary secret ----
options(
rtauargus.tauargus_exe =
"Y:/Logiciels/TauArgus/TauArgus4.2.3/TauArgus.exe"
)
res <- tab_rtauargus2(
tabular = turnover_act_size,
files_name = "turn_act_size",
dir_name = "tauargus_files",
explanatory_vars = c("ACTIVITY", "SIZE"),
hrc = c(ACTIVITY = hrc_file_activity),
totcode = c(ACTIVITY = "Total", SIZE = "Total"),
secret_var = "is_secret_prim",
value = "TOT",
freq = "N_OBS"
)
# reduce dimensions feature
data(datatest1)
res_dim4 <- tab_rtauargus2(
tabular = datatest1,
dir_name = "tauargus_files",
explanatory_vars = c("A10", "treff","type_distrib","cj"),
totcode = rep("Total", 4),
secret_var = "is_secret_prim",
value = "pizzas_tot_abs",
freq = "nb_obs_rnd",
split_tab = TRUE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.