compareIgnoreAttrs {compare}R Documentation

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.

Author(s)

Paul Murrell

See Also

compare and compareEqual

Examples

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

[Package compare version 0.2-6 Index]