apply.Speclib | R Documentation |
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
apply
, match.fun
, Speclib
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.