% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/control_matches.R
\name{control_matches}
\alias{control_matches}
\title{Show detailed match results from a thesaurus}
\usage{
control_matches(
  x,
  thesaurus,
  thesaurus_cols = c(1, 2),
  case_insensitive = FALSE,
  fuzzy_boundary = FALSE,
  fuzzy_encoding = FALSE
)
}
\arguments{
\item{x}{Vector to recode.}

\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{case_insensitive}{Set to \code{TRUE} to perform case insensitive matching.}

\item{fuzzy_boundary}{Set to \code{TRUE} to perform fuzzy matching that ignores
differences in the word boundaries used (e.g. \code{"foo bar"} matches \code{"foo-bar"}).}

\item{fuzzy_encoding}{Set to \code{TRUE} to perform fuzzy matching that ignores
non-ASCII characters that may have been encoded differently (e.g. \code{"foo"}
matches \code{"foö"}).}
}
\value{
A data frame with the same number of rows as \code{x}. The first column (\code{term})
contains the original values. Subsequent columns contain the match result
for each match type (e.g. \code{exact_match}, \code{case_insensitive_match},
\code{fuzzy_boundary_match}, \code{fuzzy_encoding_match}). Rows for NA values in \code{x}
are all NAs.
}
\description{
\code{control_matches()} returns a data frame showing which type of match was used
for each value in \code{x}. This is useful for debugging or inspecting how
\code{control()} recodes values.
}
\examples{
data(colour_thesaurus)

x <- c("red", "lipstick", "green", "mint", "blue", "azure")
control_matches(x, colour_thesaurus)
}
