set_opts {surveytable}R Documentation

Set certain options

Description

set_opts() sets certain 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).

Usage

set_opts(
  mode = NULL,
  count = NULL,
  lpe = NULL,
  drop_na = NULL,
  max_levels = NULL,
  csv = NULL,
  output = NULL
)

show_opts()

Arguments

mode

"general" or "NCHS". See below for details.

count

round counts to the nearest: integer ("int") or one thousand ("1k")

lpe

identify low-precision estimates?

drop_na

drop missing values (NA)? Categorical variables only.

max_levels

a categorical variable can have at most this many levels. Used to avoid printing huge tables.

csv

name of a CSV file or "" to turn off CSV output.

output

package to use for printing. One of "huxtable", "gt", or "kableExtra". For the last two, be sure that this package is installed. "auto" (default) = automatically select huxtable for screen, gt for HTML, or kableExtra for PDF (LaTeX).

Details

If you are not setting a particular option, leave it as NULL.

mode can be either "general" or "NCHS" and has the following meaning:

Value

(Nothing.)

See Also

Other options: set_survey(), show_options(), surveytable-options

Examples

# Send output to a CSV file:
file_name = tempfile(fileext = ".csv")
suppressMessages( set_opts(csv = file_name) )
set_survey(namcs2019sv)
tab("AGER")
set_opts(csv = "") # Turn off CSV output

show_opts()

[Package surveytable version 0.9.8 Index]