Description Usage Arguments Value Examples
This function allows to write a problem instance in JJ-Format to a file.
1 2 | writeJJFormat(x, tabvar = "freqs", path = "out.jj",
overwrite = FALSE)
|
x |
an input produced by |
tabvar |
the name of the variable that will be used when producing the
problem in JJ format. It is possible to specify |
path |
a scalar character defining the name of the file that should be written. This can be an absolute or relative URL; however the file must not exist. |
overwrite |
logical scalar, if |
invisibly the path to the file that was created.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 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 = "prob_freqs.jj", overwrite = TRUE)
# or using the numeric variable `val` previously specified
writeJJFormat(inp, tabvar = "val", path = "prob_val.jj", overwrite = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.