Learn R Programming

compare (version 0.2-6)

compareIgnoreAttrs: Compare Two Objects with Different Attributes

Description

Compare two objects for equality, ignoring any attributes if necessary beforehand.

Usage

compareIgnoreAttrs(model, comparison, transform = character(), equal = TRUE, ...)

Arguments

model
The “correct” object.
comparison
The object to be compared with the model.
transform
A character vector containing any transformations that have been performed on the objects prior to this comparison.
equal
Whether to test for equality if the test for identity fails.
...
Arguments passed to compareEqual().

Value

An object of class "comparison". Use isTRUE() to determine whether the comparison has succeeded.

See Also

compare and compareEqual

Examples

Run this code
model <- list(a=1:26, b=letters)
comparison <- model
attr(comparison, "test") <- "test"
compareIgnoreAttrs(model, comparison)

Run the code above in your browser using DataLab