% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/category_check.R
\name{category_check}
\alias{category_check}
\title{Check Categorical Values}
\usage{
category_check(data, variable, allowed)
}
\arguments{
\item{data}{A data.frame.}

\item{variable}{A single character string specifying the
variable to check.}

\item{allowed}{A non-empty vector containing the allowed
values.}
}
\value{
A data.frame of class \code{CategoryCheck}
containing row-level category diagnostics.
}
\description{
Checks whether values in a variable belong to a
user-defined set of allowed categories.
}
\details{
Missing values are reported separately and are not
classified as invalid categories.

The supplied \code{allowed} values are compared with the
observed values using their underlying values. Character,
factor, numeric, integer, and logical variables are
supported.
}
\examples{
dat <- data.frame(
  Species = c("Dog", "Cat", "Horse", NA),
  stringsAsFactors = FALSE
)

category_check(
  dat,
  variable = "Species",
  allowed = c("Dog", "Cat", "Cattle")
)

}
