Retrieves the structured metadata list attached to a survey result object
returned by any get_*() analysis function.
Value
A named list. Common fields present on every result:
design_typeCharacter(1). Design class:
"taylor","replicate","twophase","srs", or"calibrated".conf_levelNumeric(1). Confidence level used (e.g.
0.95).callLanguage. Matched call to the
get_*()function.n_respondentsInteger(1). Total rows in the design, regardless of groups, domain status, or weights.
groupNamed list. One entry per grouping variable; empty list (
list()) when no groups are active. Each entry is a named list with:variable_label(character orNULL),question_preface(character orNULL),value_labels(named vector orNULL).xNamed list. One entry per focal variable. Length 1 for single-x functions (
get_means,get_totals,get_quantiles); length N for multi-x functions (get_freqs,get_corr). Each entry has the same sub-structure asgroupentries.NULLforget_totals()when called without anxargument.
Function-specific additional fields:
probs(
get_quantilesonly) Numeric vector of quantile probabilities.method(
get_corronly) Character(1) correlation method.numerator,denominator(
get_ratiosonly) Flat named lists with keysname,variable_label,question_preface,value_labels.
Details
This is the only supported way to access result metadata — do not use
attr(result, ".meta") directly.
See also
Other analysis:
get_corr(),
get_freqs(),
get_means(),
get_quantiles(),
get_ratios(),
get_totals()
Examples
# Construct a minimal survey_result to illustrate meta():
result <- structure(
tibble::tibble(mean = 42.0, se = 1.5, n = 100L),
.meta = list(
design_type = "taylor",
conf_level = 0.95,
call = quote(get_means(d, x)),
n_respondents = 100L,
group = list(),
x = list(
x = list(variable_label = NULL, question_preface = NULL,
value_labels = NULL)
)
),
class = c("survey_means", "survey_result", "tbl_df", "tbl", "data.frame")
)
meta(result)$design_type # "taylor"
#> [1] "taylor"
meta(result)$n_respondents # 100L
#> [1] 100
meta(result)$conf_level # 0.95
#> [1] 0.95