Apply function for class Speclib
Apply function over all spectra or a subset of spectra in a Speclib.
## S4 method for signature 'Speclib' apply(X, FUN, bySI = NULL, ..., simplify = TRUE)
X | 
 Object of class   | 
FUN | 
 Function to be applied. Matched with   | 
bySI | 
 Character string giving the name of the column in the SI to be used as subsets to apply function FUN on.  | 
... | 
 Further arguments passed to FUN.  | 
simplify | 
 Currently ignored.  | 
Object of class Speclib.
Lukas Lehnert
data(spectral_data) mean_spectrum <- apply(spectral_data, FUN = mean) plot(mean_spectrum) ## Same as above but seperately for both seasons mean_spectra <- apply(spectral_data, FUN = mean, bySI = "season") plot(mean_spectra[1, ], ylim = c(0,50)) plot(mean_spectra[2, ], new = FALSE) SI(mean_spectra)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.