eem_interp {staRdom} | R Documentation |
Missing values are interpolated within EEM data
Description
Missing EEM data can be interpolated. Usually it is the result of removing scatter or other parts where noise is presumed. Different interpolation algorithms can be used (see details).
Usage
eem_interp(
data,
cores = parallel::detectCores(logical = FALSE),
type = TRUE,
verbose = FALSE,
nonneg = TRUE,
extend = FALSE,
...
)
Arguments
data |
object of class eemlist with spectra containing missing values |
cores |
specify number of cores for parallel computation |
type |
numeric 0 to 4 or TRUE which resembles type 1 |
verbose |
logical, whether more information on calculation should be provided |
nonneg |
logical, whether negative values should be replaced by 0 |
extend |
logical, whether data is extrapolated using type 1 |
... |
arguments passed on to other functions (pchip, na.approx, mba.points) |
Details
The types of interpolation are (0) setting all NAs to 0, (1) spline interpolation with mba.points
, (2) excitation and emission wavelength-wise interpolation with pchip
and subsequent mean, (3) excitation wavelength-wise interpolation with pchip
and (4) linear interpolation in 2 dimensions with na.approx
and again subsequent mean calculation. Calculating the mean is a way of ensuring NAs are also interpolated where missing boundary values would make that impossible. Using type = 1, extrapolation can be suppressed by adding the argument extend = FALSE.
Value
object of class eemlist with interpoleted spectra.
References
Elcoroaristizabal, S., Bro, R., GarcĂa, J., Alonso, L. 2015. PARAFAC models of fluorescence data with scattering: A comparative study. Chemometrics and Intelligent Laboratory Systems, 142, 124-130 doi:10.1016/j.chemolab.2015.01.017
See Also
Examples
data(eem_list)
eem_list <- eem_list[1:6]
class(eem_list) <- "eemlist"
remove_scatter <- c(FALSE, TRUE, TRUE, TRUE)
remove_scatter_width = c(15, 10, 16, 12)
eem_list <- eem_rem_scat(eem_list, remove_scatter, remove_scatter_width)
eem_list <- eem_interp(eem_list, cores = 2)
ggeem(eem_list)
eem_list2 <- eem_setNA(eem_list, ex = 200:280, interpolate=FALSE)
ggeem(eem_list2)
eem_list3 <- eem_interp(eem_list2, type = 1, extend = TRUE, cores = 2)
ggeem(eem_list3)
eem_list3 <- eem_interp(eem_list2, type = 1, extend = FALSE, cores = 2)
ggeem(eem_list3)