Convert survey to data.frame
See also
Other survey-objects:
Survey,
cat_design(),
cat_design_type(),
get_data(),
get_metadata(),
has_design(),
has_recipes(),
has_steps(),
is_baked(),
set_data(),
survey_empty(),
survey_to_datatable(),
survey_to_tibble()
Examples
dt <- data.table::data.table(
id = 1:5, age = c(25, 30, 45, 50, 60),
w = rep(1, 5)
)
svy <- Survey$new(
data = dt, edition = "2023", type = "ech",
psu = NULL, engine = "data.table", weight = add_weight(annual = "w")
)
df <- survey_to_data_frame(svy)
class(df) # "data.frame"
#> [1] "data.frame"