objects_length: Examine and Compare the Length of Objects

View source: R/objects_length.R

objects_lengthR Documentation

Examine and Compare the Length of Objects

Description

A set of functions to check and compare the length of objects objects_length returns the length value of the input object as a vector. objects_length_all_equal returns TRUE if the lengths of all input objects are equal, and FALSE if any one of them is different. objects_length_num_equal returns TRUE if the length of the input object is at least one equal to the length specified by .num. objects_length_num_equal_quantity returns the number of input objects whose length is equal to the length specified by .num. If .quantity is specified, it will return TRUE if the answer is equal to the specified number.

Usage

objects_length(...)

objects_length_all_equal(...)

objects_length_num_equal(..., .num = 1)

objects_length_num_equal_quantity(..., .num = 1, .quantity = NULL)

Arguments

...

Object to be examined.

.num

The length of the object you want to examine. It accepts multiple values, and if more than one value is entered, it checks if the length of one of the entered values matches.

.quantity

The number of objects you want to check that match the length of the object you want to check. It accepts multiple values, and if more than one value is entered, it checks if the length of one of the entered values matches.

Examples

x <- 1:3
y <- 1:6
z <- 1:3
objects_length(x, y, z)
objects_length_all_equal(x, y, z)
objects_length_num_equal(x, y, z, .num = 6)
objects_length_num_equal_quantity(x, y, z, .num = 3)
objects_length_num_equal_quantity(x, y, z, .num = 3, quantity = 2)

indenkun/infun documentation built on April 17, 2025, 2:52 p.m.