% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/FarmDynR.R
\name{first_match_col}
\alias{first_match_col}
\title{`first_match_col()` finds the first matching column in a dataframe}
\usage{
first_match_col(x, pattern, how = c("all", "any"))
}
\arguments{
\item{x}{A dataframe}

\item{pattern}{A pattern to match}

\item{how}{How to match the pattern (all or any)}
}
\value{
The name of the first matching column
}
\description{
`first_match_col()` finds the first matching column in a dataframe
}
\examples{
data <- data.frame(a = c("a", "b", "c"), b = c("a", " ", "c"), c = c("a", "b", "1"))
first_match_col(data, "\\\\D", "all")
first_match_col(data, "\\\\d", "any")
}