set_opts()
sets certain package options. To view these options, use show_opts()
.
For more advanced control and detailed customization, experienced users can
also employ options()
and show_options()
(refer to surveytable-options
for further information).
set_opts(
reset = NULL,
mode = NULL,
adj = NULL,
output = NULL,
file = NULL,
.file_temp = NULL,
count = NULL,
lpe = NULL,
drop_na = NULL,
max_levels = NULL
)show_opts()
(Nothing.)
reset all options to their default values?
"general"
or "NCHS"
. See below for details.
adjustment to the Korn and Graubard confidence intervals for proportions. See
svyciprop_adjusted()
for details.
specify how the output is printed: "auto"
(default); "huxtable"
, "gt"
, or
"kableExtra"
; "raw"
; "Excel"
or "CSV"
. If output
is "Excel"
or "CSV"
, must also specify
file
. If output
is "Excel"
, be sure to install openxlsx2
and mschart
.
file name (see output
).
place file
in a temporary folder?
round counts to the nearest integer ("int"
) or one thousand ("1k"
).
identify low-precision estimates?
drop missing values (NA
)? Categorical variables only.
a categorical variable can have at most this many levels. Used to avoid printing huge tables.
If you are not setting a particular option, leave it as NULL
.
mode
can be either "general"
or "NCHS"
and has the following meaning:
"general"
:
Round counts to the nearest integer -- same as count = "int"
.
Do not look for low-precision estimates -- same as lpe = FALSE
.
Percentage CI's: use standard Korn-Graubard CI's -- same as adj = "none"
.
"nchs"
:
Round counts to the nearest 1,000 -- same as count = "1k"
.
Identify low-precision estimates -- same as lpe = TRUE
.
Percentage CI's: adjust Korn-Graubard CI's for the number of degrees of
freedom, matching the SUDAAN calculation -- same as adj = "nchs"
. This
is appropriate for some, but not all, NCHS data systems. For some NCHS
data systems, such as NHIS, you might need to set adj
to one of the other values.
adj
specifies the adjustment to the Korn and Graubard confidence intervals for
proportions. See svyciprop_adjusted()
for details.
output
determines how the output is printed:
"auto"
(default): automatically select the table-making package, depending on the
destination (such as screen, HTML, or PDF / LaTeX).
"huxtable"
, "gt"
, or "kableExtra"
: use this table-making package. Be sure
that this package is installed.
"raw"
: unformatted / raw output. This is useful for getting lots of significant digits.
"Excel"
: print to an Excel workbook. Please specify the name of an Excel file using
the file
argument. Before using Excel printing, please be sure to install these
packages: openxlsx2
and mschart
.
"CSV"
: print to a comma-separated values (CSV) file. Please specify the name of a
CSV file using the file
argument.
Other options:
set_survey()
,
show_options()
,
surveytable-options
set_survey(namcs2019sv)
# Round counts to the nearest one thousand:
set_opts(count = "1k")
tab("AGER")
set_opts(count = "int")
show_opts()
Run the code above in your browser using DataLab