set_survey {surveytable}R Documentation

Specify the survey to analyze

Description

You must specify a survey before the other functions, such as tab(), will work. To convert a data.frame to a survey object, see survey::svydesign() or survey::svrepdesign().

Usage

set_survey(design, csv = getOption("surveytable.csv"), ...)

Arguments

design

either a survey object (created with survey::svydesign() or survey::svrepdesign()); or, for an unweighted survey, a data.frame.

csv

name of a CSV file

...

arguments to set_opts().

Details

Optionally, the survey can have an attribute called label, which is the long name of the survey. Optionally, each variable in the survey can have an attribute called label, which is the variable's long name.

Value

info about the survey

See Also

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

Examples

set_survey(namcs2019sv)
set_survey(namcs2019sv, mode = "general")

[Package surveytable version 0.9.5 Index]