% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/search_terms.R
\name{search_terms}
\alias{search_terms}
\title{Search a Term-Frequency Table}
\usage{
search_terms(
  x,
  data = inlpubs::terms,
  ignore_case = TRUE,
  ...,
  low_freq = 1,
  high_freq = Inf,
  simplify = TRUE
)
}
\arguments{
\item{x}{'character' string.
Regular-expression pattern to search for among the table's terms.}

\item{data}{'term' and 'data.frame' class.
Term-frequency table to search, with columns \code{term}, \code{pub_id}, and \code{freq}.
Defaults to the term frequencies from the INLPO publications; see the \code{\link{terms}}
dataset for details.}

\item{ignore_case}{'logical' flag.
Whether to ignore character case when matching. Defaults to \code{TRUE}.}

\item{...}{Additional arguments passed to \code{\link[=grep]{grep()}} (for example, \code{fixed} or \code{perl}).}

\item{low_freq}{'numeric' number.
Lower frequency bound; terms occurring fewer than this many times are excluded.
Defaults to 1.}

\item{high_freq}{'numeric' number.
Upper frequency bound; terms occurring more than this many times are excluded.
Defaults to \code{Inf} (no upper limit).}

\item{simplify}{'logical' flag.
Whether to return only the unique publication identifiers (\code{TRUE}, the default)
rather than the full table of matching rows.}
}
\value{
If \code{simplify = TRUE}, a 'character' vector of unique publication
identifiers, ordered by the most frequent matching term first. If
\code{simplify = FALSE}, a 'data.frame' of matching rows sorted by decreasing
frequency.
}
\description{
Search a term-frequency table by pattern or frequency.
}
\examples{
search_terms("mlms")

out <- search_terms("mlms", simplify = FALSE)
head(out)
}
\seealso{
\code{\link{mine_text}} to build a term-frequency table.
}
\author{
J.C. Fisher, U.S. Geological Survey, Idaho Water Science Center
}
