% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/control_names.R
\name{control_names}
\alias{control_names}
\alias{control_names_ci}
\alias{control_names_fuzzy}
\title{Control the names of an object}
\usage{
control_names(x, thesaurus, thesaurus_cols = c(1, 2), ...)

control_names_ci(x, thesaurus, thesaurus_cols = c(1, 2), ...)

control_names_fuzzy(x, thesaurus, thesaurus_cols = c(1, 2), ...)
}
\arguments{
\item{x}{Object with names to control.}

\item{thesaurus}{Data frame with a vector of preferred terms and a vector of
variants.}

\item{thesaurus_cols}{Vector of two column names or positions specifying which
columns in \code{thesaurus} contain the preferred terms and variants
respectively. Defaults to the first two columns.}

\item{...}{Other arguments passed to \code{\link[=control]{control()}}. This includes fuzzy
matching options (\code{case_insensitive}, \code{fuzzy_boundary}, \code{fuzzy_encoding})
and output options (\code{quiet}, \code{warn_unmatched}).}
}
\value{
The object \code{x} with its names replaced by controlled values.
}
\description{
\code{control_names()} controls the names of an object using a thesaurus.
It extracts the names of \code{x}, passes them to \code{\link[=control]{control()}}, and reassigns
the result to \code{names(x)}.

\code{control_names_ci()} and \code{control_names_fuzzy()} are convenience aliases
for case insensitive and full fuzzy matching respectively.
}
\examples{
df <- data.frame(temp = 20, humid = 65, `wind speed` = 10, date = "2024-01-01")
thesaurus <- data.frame(
  preferred = c("temperature", "humidity", "wind_speed"),
  variant = c("temp", "humid", "wind speed")
)
control_names(df, thesaurus)
}
