Do the inputs have the same length?

areSameLength(x, y, .xname = getNameInParent(x),
  .yname = getNameInParent(y))

Arguments

x

Object.

y

Secondary object.

.xname

Not intended to be used directly.

.yname

Not intended to be used directly.

Value

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

Note

Non-zero lengths for x and y are required, otherwise the check function will intentionally error.

Examples

## TRUE ==== x <- list(a = 1L, b = 2L) y <- list(c = 3L, d = 4L) areSameLength(x = x, y = y)
#> [1] TRUE
## FALSE ==== x <- list(a = 1L) y <- list(b = 2L, c = 3L) areSameLength(x = x, y = y)
#> [1] FALSE #> Cause of failure: #> x does not have the same length as y.