@@ -123,6 +123,15 @@ check_suppmethod <- function(method) {
123123 method
124124}
125125
126+ # no colons in var-labels (https://github.com/sdcTools/UserSupport/issues/301)
127+ check_colon <- function (x ) {
128+ for (n in names(x )) {
129+ if (sum(grepl(" ," , x [[n ]]$ codes )) > 0 ) {
130+ stop(" Colon (,) detected in a label for dimensional variable " , shQuote(n ))
131+ }
132+ }
133+ invisible (TRUE )
134+ }
126135
127136# ##############################################################################################################
128137# #### helper-functions that are used to create hierarchy-files for tau-argus using an sdcProblem-instance #####
@@ -218,8 +227,9 @@ create_microdata_and_metadata <- function(obj, verbose, digits=2, path=getwd(),
218227 # define output-matrix (required for fixed-file format)
219228 mat <- matrix (" " , nrow = nrow(mdat ), ncol = 1 )
220229
221- # calculate hierarchy-files
230+ # calculate and check hierarchy-files
222231 hiercodes <- hrc(obj )
232+ check_colon(x = hiercodes )
223233
224234 # write microdata
225235 # 1: dim-vars
@@ -352,8 +362,9 @@ create_tabdata_and_metadata <- function(obj, verbose, responsevar, digits=2, pat
352362 # define output-matrix (required for fixed-file format)
353363 mat <- matrix (" " , nrow = nrow(mdat ), ncol = 1 )
354364
355- # calculate hierarchiy -files
365+ # calculate and check hierarchy -files
356366 hiercodes <- hrc(obj )
367+ check_colon(x = hiercodes )
357368
358369 # write microdata
359370 # 1: dim-vars
0 commit comments