Learn R Programming

surveycore (version 0.8.3)

survey_data: Access the Data Component of a Survey Design Object

Description

Returns the underlying data frame stored in a survey design object. This is a thin accessor for x@data that provides a stable public name independent of the S7 property structure.

Usage

survey_data(x)

Value

A data.frame with all variables, including design variables.

Arguments

x

A survey_taylor, survey_replicate, or survey_twophase object.

See Also

Other constructors: as_survey(), as_survey_nonprob(), as_survey_replicate(), as_survey_twophase(), survey_glm(), survey_glm_fit(), survey_nonprob(), survey_replicate(), survey_taylor(), survey_twophase()

Examples

Run this code
d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
               strata = sdmvstra, nest = TRUE)
head(survey_data(d))

Run the code above in your browser using DataLab