Skip to content

Commit 5f14aae

Browse files
committed
Use correct overall total-codes when using createArgusInput()
1 parent 300cda5 commit 5f14aae

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# sdcTable next
1+
# sdcTable 0.32.7
22
- Additional check for `createArgusInput()` to make sure that the holding variable is integer (if specified)
33
- Additional check for colons in labels in `createArgusInput()`
4+
- Fix non-default Totals whe using `createArgusInput()`
45

56
# sdcTable 0.32.6
67
- Improvements in `SIMPLEHEURISTIC` when adding additional suppressions

R/tauBatch_helpers.R

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ create_microdata_and_metadata <- function(obj, verbose, digits=2, path=getwd(),
256256
f_hrc <- normalizePath(f_hrc, winslash="/", mustWork=TRUE)
257257
cmds <- append(cmds, paste(vv, cur_dig)) # no missings allowed in sdcProblem-objects
258258
cmds <- append(cmds, paste(bl, "<RECODEABLE>"))
259+
cmds <- append(cmds, paste(bl, "<TOTCODE>", shQuote(slot(di, "dimInfo")[[vv]]@codesOriginal[1])))
259260
cmds <- append(cmds, paste(bl, "<HIERCODELIST>", dQuote(f_hrc)))
260261
cmds <- append(cmds, paste(bl, "<HIERLEADSTRING>", dQuote("@")))
261262
cmds <- append(cmds, paste(bl, "<HIERARCHICAL>"))
@@ -376,6 +377,7 @@ create_tabdata_and_metadata <- function(obj, verbose, responsevar, digits=2, pat
376377
# --> all have <HIERLEADSTRING>
377378
# --> none have <REQUEST> or <HOLDING>: currently not supported
378379
dim_vars <- names(hiercodes)
380+
di <- slot(obj, "dimInfo")
379381
f_hrcs <- c()
380382
for (i in seq_along(dim_vars)) {
381383
vv <- dim_vars[i]
@@ -396,6 +398,7 @@ create_tabdata_and_metadata <- function(obj, verbose, responsevar, digits=2, pat
396398

397399
cmds <- append(cmds, paste(vv)) # no missings allowed in sdcProblem-objects
398400
cmds <- append(cmds, paste(bl, "<RECODEABLE>"))
401+
cmds <- append(cmds, paste(bl, "<TOTCODE>", shQuote(slot(di, "dimInfo")[[vv]]@codesOriginal[1])))
399402
cmds <- append(cmds, paste(bl, "<TOTCODE>", dQuote(tot_code)))
400403
cmds <- append(cmds, paste(bl, "<HIERCODELIST>", dQuote(f_hrc)))
401404
cmds <- append(cmds, paste(bl, "<HIERLEADSTRING>", dQuote("@")))

0 commit comments

Comments
 (0)