Do the inputs have the same length?

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

Arguments

x

Object.

y

Object.

.xname

Name of object defined in x. Not intended to be used directly.

.yname

Name of object defined in y. Not intended to be used directly.

Value

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

Note

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

Updated 2019-08-10.

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: 'x' does not have the same length as 'y'.