Comparison of hyperSpec objects
The comparison operators >
, <
, >=
, <=
,
==
, and !=
for hyperSpec
objects.
## S4 method for signature 'hyperSpec,hyperSpec' Compare(e1, e2) ## S4 method for signature 'hyperSpec,numeric' Compare(e1, e2) ## S4 method for signature 'hyperSpec,matrix' Compare(e1, e2) ## S4 method for signature 'numeric,hyperSpec' Compare(e1, e2) ## S4 method for signature 'matrix,hyperSpec' Compare(e1, e2) ## S4 method for signature 'hyperSpec,hyperSpec' all.equal( target, current, ..., check.attributes = FALSE, check.names = FALSE, check.column.order = FALSE, check.label = FALSE, tolerance = hy.getOption("tolerance"), wl.tolerance = hy.getOption("wl.tolerance") )
e1, e2 |
Either two As |
target, current |
two |
... |
handed to |
check.attributes, check.names |
see |
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 |
tolerance, wl.tolerance |
tolerances for checking wavelengths and data, respectively |
all.equal
checks the equality of two hyperSpec objects.
The comparison operators >
, <
, >=
, <=
,
==
, 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
.
a logical matrix for the comparison operators.
all.equal
returns either TRUE
, or a character vector describing the
differences. In conditions, the result must therefore be tested with
isTRUE
.
C. Beleites
sweep-methods
for calculations involving
a vector and the spectral matrix.
S4groupGeneric
for group generic methods.
Comparison
for the base comparison functions.
flu [,,445 ~ 450] > 300 all (flu == flu[[]])
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.