lengths_match: Do the objects have the same lengths?

View source: R/is_are.R

lengths_matchR Documentation

Do the objects have the same lengths?

Description

Checks whether the nth dimension lengths match for the given objects.

Usage

lengths_match(..., dimension = 1)

Arguments

...

(objects) The objects to test.

dimension

(num scalar) The dimension to test.

Details

Vectors are treated as 1-dimensional.

Value

Logical scalar.

Examples

lengths_match(1:4, 5:8) #same lengths
lengths_match(iris, iris[1:2]) #same nrow
lengths_match(iris, iris[1:2], dimension = 2) #different ncol
lengths_match(iris, 1:3, dimension = 2) #incompatible objects

Deleetdk/kirkegaard documentation built on Sept. 20, 2024, 11:08 a.m.