Remove outlier spectra based on the
pcout()
function of the mvoutlier
package.
remove_outliers(list_spectra, remove = TRUE)
Returns list spectra_out
that contains:
MIR_mean
: Outlier removed MIR spectra as
data.frame object. If remove = FALSE
,
the function will
return almost identical list identical to list_spectra
,
except that the first indices
column of the spectral
data frame MIR_mean
is removed
(This is done for both options
remove = TRUE
and remove = FALSE
).
data_meta
: metadata data.frame, identical
as in the list_spectra
input list.
plot_out
: (optional) ggplot2 graph
that shows all spectra (absorbance on x-axis and wavenumber
on y-axis) with outlier marked, if
remove = TRUE
.
This is an optional function if one wants to remove outliers.