Description Usage Arguments Value Author(s) Examples
Compute statistic across several spectra subset to a specified spectral range
1 2 3 4  | StatsOnSpectra(wl, wlStart = wl[1], wlEnd = wl[length(wl)], spectra = spectra, 
    fun = "mean", margin = 1)
 | 
wl | 
 numeric vector: wavelength for each row in spectra  | 
wlStart | 
 numeric value or vector: first wavelength of the spectral range selection. Default value: first wavelength of wl vector  | 
wlEnd | 
 numeric value or vector: last wavelength of the spectral range selection. Default value: last wavelength of wl vector  | 
spectra | 
 numeric matrix or data.frame: collection of several spectra acquired by several columns (Digital numbers, Radiance, Reflectance).  | 
fun | 
 character or function: function to be applied on each row of the data.frame. Default function: mean  | 
margin | 
 numeric value: a vector giving the subscripts which the function will be applied over. 1 indicates rows, 2 indicates columns  | 
numeric data.frame containing the computed statistic across the selected spectral range.
Tommaso Julitta, Mirco Migliavacca, Thomas Wutzler
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  |   
data("snr_data")
#perform statistics on spectra
#calculate mean of the  signal between 700 and 800 nm
mean<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_lamp,fun='mean',wlStart=700,wlEnd = 800)
#calculate stadard deviation of the signal between 700 and 800 nm
sd<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_lamp,fun='sd',wlStart=700,wlEnd = 800)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.