# NOT RUN {
data("microData1", package = "sdcTable")
# create hierarchies
dimList <- list(
region = hier_create(root = "Total", nodes = LETTERS[1:4]),
gender = hier_create(root = "Total", nodes = c("male", "female")))
# create a problem instance
prob <- makeProblem(
data = microData1,
dimList = dimList,
numVarInd = "val")
# create suitable input for `writeJJFormat`
inp <- createJJFormat(prob); inp
# write files to disk
# frequency table by default
writeJJFormat(inp, path = file.path(tempdir(), "prob_freqs.jj"), overwrite = TRUE)
# or using the numeric variable `val` previously specified
writeJJFormat(inp, tabvar = "val", path = file.path(tempdir(), "prob_val.jj"), overwrite = TRUE)
# }
Run the code above in your browser using DataLab