Skip to contents

A semantic operator that checks whether two objects are strictly identical, and prints where they differ if not.

Usage

a %is% b

Arguments

a

First object (vector, matrix, or data.frame)

b

Second object (vector, matrix, or data.frame)

Value

TRUE if identical, FALSE otherwise (with diagnostics)

Examples

1:3 %is% 1:3          # TRUE
#> [1] TRUE
1:3 %is% c(1, 2, 3)   # FALSE, type mismatch
#> ── ❌ Objects are NOT identical ────────────────────────────────────────────────
#>  Type mismatch: "integer" vs "double"
#>  Class mismatch: "integer" vs "numeric"
#> [1] FALSE
data.frame(x=1) %is% data.frame(y=1)  # FALSE, name mismatch
#> ── ❌ Objects are NOT identical ────────────────────────────────────────────────
#>  Column names differ: "x" vs "y"
#>  Values are not identical.
#> [1] FALSE