## Single spectrum
spectrum <- PROSPECT(N = 1.3, Cab = 30, Car = 10, Cbrown = 0,
Cw = 0.01, Cm = 0.01)
plot(spectrum)
## Example using parameterList
## Test effect of leaf structure and chlorophyll content on
## spectra
parameter <- data.frame(N = c(rep.int(seq(0.5, 1.5, 0.5), 2)),
Cab = c(rep.int(40, 3), rep.int(20, 3)))
spectra <- PROSPECT(parameterList = parameter)
## Print attributes table
attribute(spectra)
## Plot spectra for range from 400 to 800 nm
spectra <- spectra[,wavelength(spectra) >= 400 &
wavelength(spectra) <= 800]
plot(subset(spectra, Cab == 20), col = "red", ylim = c(0, 0.5))
plot(subset(spectra, Cab == 40), col = "green", new = FALSE)
Run the code above in your browser using DataLab