Learn R Programming

assertive (version 0.2-6)

are_same_length: Are the inputs the same length

Description

Checks if the inputs are the same length.

Usage

are_same_length(..., l = list())

assert_all_are_same_length(..., l = list())

assert_any_are_same_length(..., l = list())

Arguments

...
Some R expressions.
l
A list of R expressions.

Value

  • A symmetric square logical matrix which is TRUE where pairs of inputs are the same length.

See Also

length, are_identical

Examples

Run this code
x <- 1:5
are_same_length(
  runif(5), x, list(1, 2:3, 4:6, 7:10, 11:15), 1:6,
  l = list(seq.int(0, 1, 0.2), rnorm(5))
)
assert_any_are_same_length(runif(5), x, list(1, 2:3, 4:6, 7:10, 11:15), 1:6)
dont_stop(assert_all_are_same_length(runif(5), x, list(1, 2:3, 4:6, 7:10, 11:15), 1:6))

Run the code above in your browser using DataLab