Skip to contents

This function checks whether all elements in a list have and equal length. It is useful when validating argument consistency in list-based input, especially when recycling or vectorised operations depend on uniform lengths.

Usage

eq_arg_n(x)

Arguments

x

A list of vectors.

Value

A logical scalar: TRUE if all elements have the same length, FALSE otherwise.

Examples

eq_arg_n(list(1:3, 4:6))      # TRUE
#> [1] TRUE
eq_arg_n(list(1:3, 4:5))      # FALSE
#> [1] FALSE
eq_arg_n(list("a", "b", "c")) # TRUE
#> [1] TRUE