equal: Compare two objects

%unf%R Documentation

Compare two objects

Description

Function to compare the size, structure, arrangement, and UNFs of two objects.

Usage

x %unf% y

unf_equal(x, y, ...)

Arguments

x

A vector, matrix, dataframe, list, or object of class “UNF”, or a one-element character vector containing a UNF signature.

y

A vector, matrix, dataframe, list, or object of class “UNF”, or a one-element character vector containing a UNF signature.

...

Additional arguments passed to unf.

Details

Compares two objects using all.equal and additional details based on the UNF of the two objects (and, for lists, dataframes, and matrices) the constituent vectors thereof. The print method for class UNFtest prints the UNFs for both objects and summarizes any differences between the objects. This is helpful for identifying mismatching variables.

Value

An object of class UNFtest containing the results of unf for both objects and both identical and all.equal for the comparison of the two.

Author(s)

Thomas J. Leeper

See Also

unf

Examples

a <- data.frame(x1=1:10, x2=11:20)
b <- data.frame(x1=1:10, x2=11:20+.0005)
a %unf% a
a %unf% b
unf_equal(a, b, digits = 3)

unf(a) %unf% "UNF6:aKW4lAFNBH8vfrnrDbQZjg=="


UNF documentation built on April 13, 2022, 5:06 p.m.