Description Usage Arguments Value Author(s) Examples
View source: R/ConvolutionFunction.R
Function to compute the statistics (mean, median, and standard deviation) of a spectrum given a certain spectral range
1 2 3 4 | fConvol(Wl = wl, Wl_start = wl[1], Wl_end = wl[length(wl)], Ref = Ref,
fun = "mean")
|
Wl |
numeric array: wavelenghts spectrometer |
Wl_start |
First wavelenght of the spectral range. By default wl[1] |
Wl_end |
Last wavelenght of the spectral range. By default last element of the array wl |
Ref |
numeric array: Reflectance |
fun |
character. statistics to compute (mean, sd, median). By default mean |
data frame with mean and standard deviation in the spectral range Wl_start - Wl_end
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 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | data("reflOO")
# Select starting wavelenght
Wl_start<-600
# Select last wavelenght
Wl_end<-650
#extract the mean and sd value
res<-fConvol(reflOO$Wl, Wl_start=Wl_start, Wl_end=Wl_end, reflOO$Ref)
#Plot results
plot(reflOO$Wl, reflOO$Ref, ylim=c(0,0.7),xlim=c(400,900), type="l",xlab = "Wl [nm]", ylab= "Reflectance [-]")
points(mean(c(Wl_start,Wl_end)), res$mean, col="red")
legend("topleft",col=c("red"),pch=1,cex=1.2,legend=c("Mean value"),box.col="white")
box()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.