Learn R Programming

hyperSpec (version 0.98-20140523)

all.equal: Comparison of hyperSpec objects

Description

Comparison Operators: <,>, <=,>=, ==, and != The comparison operators >, <, >=, <=< code="">, ==, and != for hyperSpec objects.

Usage

## S3 method for class 'hyperSpec,hyperSpec':
all.equal(target,
    current, ..., check.attributes = FALSE,
    check.names = FALSE, check.column.order = FALSE,
    check.label = FALSE, check.log = FALSE)

## S3 method for class 'hyperSpec,hyperSpec': Compare(e1, e2)

## S3 method for class 'hyperSpec,numeric': Compare(e1, e2)

## S3 method for class 'hyperSpec,matrix': Compare(e1, e2)

## S3 method for class 'numeric,hyperSpec': Compare(e1, e2)

## S3 method for class 'matrix,hyperSpec': Compare(e1, e2)

Arguments

target,current
two hyperSpec objects that are tested for equality
...
handed to all.equal when testing the slots of the hyperSpec objects
check.column.order
If two objects have the same data, but the order of the columns (determined by the names) differs, should they be regarded as different?
check.label
Should the slot label be checked? If the labels differ only in the order of their entries, they are conidered equal.
check.log
Should the slot label be checked?
check.attributes,check.names
e1,e2
Either two hyperSpec objects or one hyperSpec object and matrix of same size as hyperSpec[[]] or a scalar (numeric of length 1).

As hyperSpec objects must have numeric spectra matrices, the resu

Value

  • all.equal returns either TRUE, or a character vector describing the differences. In conditions, the result must therefore be tested with isTRUE.

    a logical matrix for the comparison operators.

Details

all.equal checks the equality of two hyperSpec objects.

The comparison operators >, <, >=, <=< code="">, ==, and != work on the spectra matrix of the hyperSpec object. They have their usual meaning (see Comparison). The operators work also with one hyperSpec object and a numeric (scalar) object or a matrices of the same size as the spectra matrix of the hyperSpec object.

With numeric vectors sweep might be more appropriate.

If you want to calculate on the data.frame hyperSpec@data, you have to do this directly on hyperSpec@data.

See Also

all.equal and isTRUE

sweep-methods for calculations involving a vector and the spectral matrix.

S4groupGeneric for group generic methods.

Comparison for the base comparison functions.

Arith for arithmetic operators, Math for mathematical group generic functions (groups Math and Math2) working on hyperSpec objects.

Examples

Run this code
all.equal (flu, --flu);
flu [,,445 ~ 450] > 300

all (flu == flu[[]])

Run the code above in your browser using DataLab