Skip to contents

Do the inputs have the same length?

Usage

areSameLength(x, y)

Arguments

x

Object.

y

Object.

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 2023-09-29.

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