% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/interval_utils.R
\name{check_zero_width_intervals}
\alias{check_zero_width_intervals}
\title{Check for Zero-Width Intervals}
\usage{
check_zero_width_intervals(data, tol = 0, warn = TRUE)
}
\arguments{
\item{data}{Interval-valued data, in one of two accepted formats:
\itemize{
  \item a \code{data.frame} in MM format with paired \code{_min}/\code{_max}
  columns, or
  \item a \code{symbolic_tbl} (RSDA format) with \code{symbolic_interval}
  columns. Non-interval columns (e.g. set/modal variables) are ignored.
}}

\item{tol}{Non-negative numeric tolerance. An interval is flagged when
\code{abs(max - min) <= tol}. Defaults to \code{0} (exact \code{min == max}).}

\item{warn}{Logical; if \code{TRUE} (default) a single warning naming the
affected variables is emitted when zero-width intervals are found.}
}
\value{
Invisibly, a logical scalar: \code{TRUE} if any zero-width interval
is present, otherwise \code{FALSE}. The returned value carries two attributes:
\code{"flagged"}, a logical \code{[n, p]} matrix marking each zero-width cell
(rows = concepts, columns = interval variables), and \code{"variables"}, the
names of variables containing at least one zero-width interval.
}
\description{
Checks whether interval-valued data contains any zero-width
intervals (\code{min == max}). Such degenerate intervals break downstream
tools that divide by interval width (e.g.
\code{ggInterval::ggInterval_indexImage()}). The input may be supplied either
in MM format (a \code{data.frame} with paired \code{_min}/\code{_max} columns)
or in RSDA format (a \code{symbolic_tbl} with \code{symbolic_interval}
columns).
}
\examples{
# MM format (paired _min/_max columns)
data(mushroom.int.mm)
check_zero_width_intervals(mushroom.int.mm)

# RSDA format (symbolic_tbl)
data(mushroom.int)
check_zero_width_intervals(mushroom.int)
}
