set_opts {surveytable}R Documentation

Set certain options

Description

set_opts() sets certain options. show_opts() shows the options that have been set. More advanced users can also use options() and show_options() for more detailed control.

Usage

set_opts(
  mode = NULL,
  count = NULL,
  lpe = NULL,
  drop_na = NULL,
  max_levels = NULL,
  csv = 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

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.5 Index]