Does the input have elements?

isEmpty(x, metric = c("length", "elements"),
  .xname = getNameInParent(x))

isNonEmpty(x, metric = c("length", "elements"),
  .xname = getNameInParent(x))

hasElements(x, n, .xname = getNameInParent(x))

isOfDimension(x, n, .xname = getNameInParent(x))

isOfLength(x, n, .xname = getNameInParent(x))

isNonEmpty(x, metric = c("length", "elements"),
  .xname = getNameInParent(x))

Arguments

x

Object.

metric

XXX.

.xname

Not intended to be used directly.

n

XXX.

Value

TRUE on success; FALSE on failure, with cause attribute set.

See also

Examples

## TRUE ==== hasElements("hello", n = 1)
#> [1] TRUE
hasElements(list(a = 1, b = 2), n = 2)
#> [1] TRUE
## FALSE ==== hasElements(list(), n = 1)
#> [1] FALSE #> Cause of failure: #> list() has 0 elements, not 1.