all_identical: Check all the Objects Are Identical

View source: R/18_others.R

all_identicalR Documentation

Check all the Objects Are Identical

Description

all_identical checks if all provided objects are pairwise identical and returns a symmetric matrix showing the comparison results between all object pairs.

Usage

all_identical(..., names = NULL)

Arguments

...

Objects to compare for identity

names

Optional character vector of names for the objects. If not provided, objects will be named as "Obj1", "Obj2", etc.

Details

This function provides a comprehensive way to compare multiple objects at once, returning a matrix that shows all pairwise comparisons. This is particularly useful for testing and validation scenarios where you need to verify that multiple objects are identical.

Value

A symmetric logical matrix where entry [i, j] indicates whether object i is identical to object j. The matrix has dimensions n x n where n is the number of objects, with row and column names from the names parameter.

See Also

identical() for pairwise object comparison, matrix() for creating matrices

Examples

# Compare identical objects
x <- 1:5
y <- 1:5
z <- 1:5

# All objects are identical
result <- all_identical(x, y, z)
print(result)

# Compare different objects with custom names
a <- 1:3
b <- 1:5
c <- 1:3

result2 <- all_identical(a, b, c, names = c("first", "second", "third"))
print(result2)

# Single object case
single_result <- all_identical(x)
print(single_result)


SigBridgeRUtils documentation built on Sept. 29, 2026, 5:09 p.m.