% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/consistency_check.R
\name{consistency_check}
\alias{consistency_check}
\title{Check Consistency Between Two Variables}
\usage{
consistency_check(data, variable1, variable2, relationship)
}
\arguments{
\item{data}{A data.frame.}

\item{variable1}{A single character string specifying the
first variable.}

\item{variable2}{A single character string specifying the
second variable.}

\item{relationship}{A character string specifying the
expected relationship between the variables. Supported
relationships are \code{"<"}, \code{"<="}, \code{">"},
\code{">="}, \code{"=="}, and \code{"!="}.}
}
\value{
A data.frame of class \code{ConsistencyCheck}
containing row-level consistency diagnostics.
}
\description{
Checks whether values in two variables satisfy a specified
logical relationship.
}
\details{
The function evaluates the relationship as
\code{variable1 relationship variable2}.

For example, when checking whether an end date occurs on
or after a start date, use:

\code{variable1 = "EndDate"},
\code{variable2 = "StartDate"}, and
\code{relationship = ">="}.

Rows containing a missing value in either variable are
reported separately and are not classified as consistent.

The two variables must have compatible types for the
requested comparison.
}
\examples{
dat <- data.frame(
  StartDate = as.Date(c(
    "2026-01-01",
    "2026-02-01",
    "2026-03-01"
  )),
  EndDate = as.Date(c(
    "2026-01-10",
    "2026-01-20",
    "2026-03-15"
  ))
)

consistency_check(
  dat,
  variable1 = "EndDate",
  variable2 = "StartDate",
  relationship = ">="
)

}
