% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lpr_set_attr.R
\name{lpr_set_attr}
\alias{lpr_set_attr}
\title{Set Variable Attributes from AmericasBarometer Notes (with propagation)}
\usage{
lpr_set_attr(
  data,
  notes,
  noteid = character(),
  attribute_name = character(),
  verbose = FALSE,
  propagate = TRUE,
  overwrite = TRUE
)
}
\arguments{
\item{data}{data.frame with variables to annotate}

\item{notes}{data.frame with columns variable_name, note_id, note_value}

\item{noteid}{character scalar; which note_id to use (e.g., "qtext_en")}

\item{attribute_name}{character scalar; attribute name to set (e.g., "qwording_en")}

\item{verbose}{logical; if TRUE it prints all variables notes available but not found in data}

\item{propagate}{logical; if TRUE, also set on <varname>_* children.
Useful for nominal variables or multiple response options variables. Default TRUE.}

\item{overwrite}{logical; if FALSE, do not overwrite existing attribute on a variable. Default TRUE.}
}
\value{
The input data frame with attributes applied (i.e., question wording)
}
\description{
Applies notes stored in a data frame as attributes to variables in `data`.
If a variable has expanded children (e.g., vb20_1, vb20_2), the attribute
is propagated to all of them by default.
}
