% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/interaction.R
\name{interaction_vars}
\alias{interaction_vars}
\title{Declare interaction variable pairs for \code{tidyselect}}
\usage{
interaction_vars(
  var1,
  var2,
  vars = tidyselect::peek_vars(fn = "interaction_vars")
)
}
\arguments{
\item{var1}{An unquoted variable name.}

\item{var2}{An unquoted variable name that interacts with \code{var1}.}

\item{vars}{Character vector of available variable names, retrieved
automatically via \code{\link[tidyselect:peek_vars]{tidyselect::peek_vars()}}.}
}
\value{
An integer vector of length 2 giving the positions of \code{var1} and
\code{var2} in \code{vars}, or \code{NA} where a variable is not found.
}
\description{
Used inside \code{tidyselect} expressions to declare a pair of variables that
interact with each other. The pair is recorded in the selection environment
and the positions of both variables within the available variables are
returned.
}
\examples{
picks(
  datasets("ADAE"),
  variables(
    c(AGE, RACE, interaction_vars("COUNTRY", "RACE")),
    selected = "COUNTRY:RACE",
    multiple = TRUE
  ),
  values()
)
}
