compare (version 0.2-6)

comparison-class: Comparison Between Two Objects

Description

This class is used to represent the result of a comparison between two objects. It is just a list, with the following components:
result
Logical value indicating whether the comparison succeeded (the objects were the same).

transform
Character vector of descriptions of any transformations that have been applied to the objects being compared.

tM
The transformed model object.

tC
The transformed comparison object.

tMpartial
The partially transformed model object.

tCpartial
The partially transformed comparison object.

partialTransform
The transformations that have been applied to the objects being compared, except for any transformations that were applied during the test for equality (i.e., by compareEqual()).

Usage

isTRUE(x)
transforms(comp)

Arguments

x, comp
A comparison object.

Value

isTRUE() returns a logical value, based on the comparison result.transforms() returns a character vector of transformation descriptions.

Details

Partial values in the result of a comparison are useful for when a comparison fails, but a subsequent comparison will be attempted, i.e., for daisy-chaining the various compareSomething() functions, i.e., what compare() does.

See Also

compare and compareEqual

Examples

Run this code
isTRUE(compareIgnoreOrder(1:10, 10:1))
transforms(compareIgnoreOrder(1:10, 10:1))

Run the code above in your browser using DataLab