% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/helper_debugPrint.R
\name{is_empty}
\alias{is_empty}
\title{Test whether an object is *empty*}
\usage{
is_empty(x)
}
\arguments{
\item{x}{Any R object.}
}
\value{
A logical scalar (`TRUE` if `x` is empty, `FALSE` otherwise).
}
\description{
This lightweight helper mimics the behaviour of `pracma::isempty()` but
depends only on base R.  An object is considered *empty* when it contains
no data:
  * `NULL`
  * an atomic vector, matrix, array or factor of length 0
  * a list (including named lists) of length 0
  * a data frame with zero rows (`nrow == 0`)
}
\details{
The function is deliberately strict - environments, functions, S4/R6
objects, etc. are **not** treated as empty.  If you need additional
classes to be regarded as empty you can extend the internal checks.
}
\examples{
\dontrun{
is_empty(NULL) # TRUE
is_empty(numeric(0)) # TRUE
is_empty(list()) # TRUE
is_empty(data.frame()) # TRUE
is_empty(1:5) # FALSE
is_empty(list(a = 1)) # FALSE
is_empty(data.frame(x = 1)) # FALSE
}
}
\keyword{internal}
