Learn R Programming

surveytable (version 0.9.6)

set_survey: 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"), ...)

Value

info about the survey

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.

See Also

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

Examples

Run this code
set_survey(namcs2019sv)
set_survey(namcs2019sv, mode = "general")

Run the code above in your browser using DataLab