% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/core-metadata.R
\name{set_sata}
\alias{set_sata}
\title{Set SATA (Select-All-That-Apply) Flag}
\usage{
set_sata(x, ..., variable = NULL, sata = TRUE)
}
\arguments{
\item{x}{A survey design object or \code{data.frame}.}

\item{...}{<\code{\link[tidyselect:language]{tidy-select}}> Variables to mark.
Supports selection helpers: \code{\link[tidyselect:starts_with]{tidyselect::starts_with()}},
\code{\link[tidyselect:all_of]{tidyselect::all_of()}}, \code{\link[tidyselect:all_of]{tidyselect::any_of()}}, etc. Cannot be combined
with \code{variable}.}

\item{variable}{\code{character}. Alternative programmatic interface: character
vector of variable names. Cannot be combined with \code{...}.}

\item{sata}{\code{logical(1)}. \code{TRUE} (default) marks variables as SATA; \code{FALSE}
removes the SATA flag. \code{NA} is not accepted.}
}
\value{
The modified object, invisibly.
}
\description{
Marks one or more variables as select-all-that-apply (SATA) in a survey
design object or a data frame. Unlike the other unified setters (which map
variable names to heterogeneous content), \code{set_sata()} applies a single
logical flag to all listed variables, so it uses a simplified two-convention
pattern.
}
\details{
\strong{Convention A (tidy-select \code{...})} — recommended:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{design |> set_sata(news_tv, news_online, news_radio)
design |> set_sata(starts_with("news_"))
}\if{html}{\out{</div>}}

\strong{Convention B (\code{variable} = character vector)} — programmatic:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{sata_vars <- c("news_tv", "news_online", "news_radio")
design |> set_sata(variable = sata_vars)
}\if{html}{\out{</div>}}

Setting \code{sata = FALSE} unmarks the listed variables.
}
\examples{
d <- as_survey(nhanes_2017, ids = sdmvpsu, weights = wtint2yr,
               strata = sdmvstra, nest = TRUE)
d <- set_sata(d, riagendr, ridageyr)
d <- set_sata(d, riagendr, sata = FALSE)

}
\seealso{
\code{\link[=extract_sata]{extract_sata()}} to retrieve SATA flags

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_universe}()},
\code{\link{set_val_labels}()},
\code{\link{set_var_label}()},
\code{\link{set_var_note}()},
\code{\link{survey_metadata}()},
\code{\link{survey_weighting_history}()}
}
\concept{metadata}
