Learn R Programming

assertive (version 0.2-1)

are_same_length: Are the inputs the same length

Description

Checks if the inputs are the same length.

Usage

are_same_length(...)

assert_all_are_same_length(...)

assert_any_are_same_length(...)

Arguments

...
Some 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)
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