Get data from survey
See also
Other survey-objects:
Survey,
cat_design(),
cat_design_type(),
get_metadata(),
has_design(),
has_recipes(),
has_steps(),
is_baked(),
set_data(),
survey_empty(),
survey_to_data_frame(),
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")
)
head(get_data(svy))
#> id age w
#> <int> <num> <num>
#> 1: 1 25 1
#> 2: 2 30 1
#> 3: 3 45 1
#> 4: 4 50 1
#> 5: 5 60 1