ir
objectScales spectra in an ir
object
ir_scale(x, center = TRUE, scale = TRUE, return_ir_flat = FALSE)
x
where spectra have been scaled, i.e. from each intensity value,
the average across all spectra is subtracted (when center
is a logical
value), or the respective value in center
is subtracted (when center
is
numerical), and each intensity value is divided by the standard deviation of
the intensity values at this wavenumber across all spectra (when scale
is a
logical value), or the respective value in scale
(when scale
is
numerical). NA
s are omitted during this process.
An object of class ir
, where all non-empty spectra have identical
wavenumber values.
either a logical value or numeric-alike vector of length
equal to the number of columns of x
, where
‘numeric-alike’ means that as.numeric(.)
will
be applied successfully if is.numeric(.)
is not true.
either a logical value or a numeric-alike vector of length
equal to the number of columns of x
.
Logical value. If TRUE
, the spectra are returned as
ir_flat
object.
ir_sample_data |>
ir_scale() |>
plot()
Run the code above in your browser using DataLab