Skip to contents

Convert survey to tibble

Usage

survey_to_tibble(svy)

Arguments

svy

Survey object

Value

A tibble (tbl_df) containing the survey data.

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")
)
tbl <- survey_to_tibble(svy)
class(tbl)
#> [1] "tbl_df"     "tbl"        "data.frame"