
Last chance! 50% off unlimited learning
Sale ends in
ir_add
takes two objects of class ir
, x
and
y
, and adds the intensity values of spectra in matching rows from
y
to that of x
.
ir_add(x, y)
x
where for each spectrum the respective intensity values in
y
are added.
An object of class ir
.
An object of class ir
or a numeic value. If y
is an object of class ir
, it must have the same number of rows as
x
and the same x axis values (e.g. wavenumber values) in each matching
spectrum as in x
.
x1 <-
ir::ir_add(ir::ir_sample_data, ir::ir_sample_data)
x2 <-
ir::ir_add(ir::ir_sample_data, ir::ir_sample_data[1, ])
# adding a numeric value to an object of class `ir`.
x3 <-
ir::ir_add(ir::ir_sample_data, 1)
# adding a numeric vector from an object of class `ir`.
x4 <-
ir::ir_add(
ir::ir_sample_data,
seq(from = 0, to = 2, length.out = nrow(ir::ir_sample_data))
)
Run the code above in your browser using DataLab