% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/type_check.R
\name{type_check}
\alias{type_check}
\title{Check Variable Types}
\usage{
type_check(data, expected)
}
\arguments{
\item{data}{A data.frame.}

\item{expected}{A named character vector specifying the
expected type for each variable.}
}
\value{
A data.frame of class \code{TypeCheck}
containing variable-level type diagnostics.
}
\description{
Checks whether variables in a dataset match user-defined
expected data types.
}
\details{
Supported expected types are:

\itemize{
\item \code{"numeric"}
\item \code{"integer"}
\item \code{"character"}
\item \code{"factor"}
\item \code{"logical"}
\item \code{"Date"}
\item \code{"POSIXct"}
}

The \code{expected} argument must be a named character
vector. Names correspond to variables in \code{data}.

For example:

\code{c(Age = "numeric", Species = "factor")}
}
\examples{
dat <- data.frame(
  Age = c(2, 4, 6),
  Species = factor(c("Dog", "Cat", "Dog")),
  Positive = c(TRUE, FALSE, TRUE)
)

type_check(
  dat,
  c(
    Age = "numeric",
    Species = "factor",
    Positive = "logical"
  )
)

}
