% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core-classes.R
\name{survey_metadata}
\alias{survey_metadata}
\title{Survey Metadata Container}
\usage{
survey_metadata(
  variable_labels = list(),
  value_labels = list(),
  question_prefaces = list(),
  notes = list(),
  universe = list(),
  missing_codes = list(),
  sata = list(),
  transformations = list(),
  weighting_history = list()
)
}
\arguments{
\item{variable_labels}{A named list mapping variable names to character
labels (e.g., \code{list(age = "Age in years")}).}

\item{value_labels}{A named list mapping variable names to named vectors
of value labels (e.g., \code{list(sex = c(Male = 1L, Female = 2L))}).}

\item{question_prefaces}{A named list mapping variable names to shared
question battery preface text.}

\item{notes}{A named list mapping variable names to analyst notes.}

\item{universe}{A named list mapping variable names to universe
descriptions (e.g., \code{list(age = "Adults 18+")}). Describes the
population to which a variable applies.}

\item{missing_codes}{A named list mapping variable names to atomic
vectors of missing-value codes
(e.g., \code{list(age = c(Refused = 99L, DK = 98L))}).}

\item{sata}{A named list mapping variable names to \code{TRUE} for variables
that are select-all-that-apply (SATA). Only variables explicitly marked
as SATA appear in this list — absence means the variable is not SATA.}

\item{transformations}{A named list tracking variable transformation
history (populated automatically during operations).}

\item{weighting_history}{A list recording weighting operations applied to
the survey object (e.g., raking, trimming). Each entry is written by
a \pkg{surveywts} function and contains the operation name,
parameters, effective sample size before/after, and design effect.
Always \code{list()} until a \pkg{surveywts} weighting function is
applied. Reserved for Phase 2.5.}
}
\value{
A \code{survey_metadata} object.
}
\description{
Stores variable labels, value labels, question prefaces, notes, and
transformation history for variables in a survey design object.
Automatically populated from haven-style attributes when
\code{\link[=as_survey]{as_survey()}} or related constructors are called.
}
\examples{
# Empty metadata (default)
m <- survey_metadata()
m@variable_labels

# Pre-populated metadata
m <- survey_metadata(
  variable_labels = list(age = "Respondent age", income = "Annual income"),
  value_labels = list(sex = c(Male = 1L, Female = 2L))
)
m@variable_labels$age
m@value_labels$sex

}
\seealso{
Other metadata: 
\code{\link{classify_question_type}()},
\code{\link{extract_metadata}()},
\code{\link{extract_missing_codes}()},
\code{\link{extract_question_preface}()},
\code{\link{extract_sata}()},
\code{\link{extract_universe}()},
\code{\link{extract_val_labels}()},
\code{\link{extract_var_label}()},
\code{\link{extract_var_note}()},
\code{\link{infer_question_prefaces}()},
\code{\link{set_missing_codes}()},
\code{\link{set_question_preface}()},
\code{\link{set_sata}()},
\code{\link{set_universe}()},
\code{\link{set_val_labels}()},
\code{\link{set_var_label}()},
\code{\link{set_var_note}()},
\code{\link{survey_weighting_history}()}
}
\concept{metadata}
