Ops.ir {ir} | R Documentation |
Arithmetic operations for ir
objects
Description
Arithmetic operations for ir
objects
Usage
## S3 method for class 'ir'
Ops(e1, e2)
Arguments
e1 |
An object of class |
e2 |
An object of class |
Value
e1
with intensity values of the spectra added to/subtracted
with/multiplied with/divided by those in e2
:
If
e2
is a numeric value, all intensity values in the spectra ofe1
are added/subtracted/multiplied/divided bye2
.If
e2
is anir
object with one row, it is replicated (see rep.ir) so that the row numbers match to those ofe1
and intensity values are added/subtracted/multiplied/divided row-wise.If
e2
is anir
object with the same number of rows ase1
, intensity values are added/subtracted/multiplied/divided row-wise.
Examples
## addition
ir::ir_sample_data + ir::ir_sample_data
ir::ir_sample_data + 2
## subtraction
ir::ir_sample_data - ir::ir_sample_data
ir::ir_sample_data - 2
## multiplication
ir::ir_sample_data * ir::ir_sample_data
ir::ir_sample_data * 2
## division
ir::ir_sample_data / ir::ir_sample_data
ir::ir_sample_data / 2
[Package ir version 0.2.1 Index]