## Not run:
# ## Use PROSAIL to generate some vegetation spectra with different LAI
# parameter <- data.frame(LAI = seq(0, 1, 0.01))
# spectral_data <- PROSAIL(parameterList = parameter)
#
# ## Get endmember spectra
# ## Retrieve all available spectra
# avl <- USGS_get_available_files()
#
# ## Download all spectra matching "grass-fescue"
# grass_spectra <- USGS_retrieve_files(avl = avl, pattern = "grass-fescue")
# limestone <- USGS_retrieve_files(avl = avl, pattern = "limestone")
#
# ## Integrate all spectra to Quickbird
# grass_spectra_qb <- spectralResampling(grass_spectra[1,], "Quickbird")
# limestone_qb <- spectralResampling(limestone, "Quickbird")
# spectral_data_qb <- spectralResampling(spectral_data, "Quickbird")
#
#
# em <- speclib(spectra = rbind(spectra(grass_spectra_qb),
# spectra(limestone_qb))/100,
# wavelength = wavelength(limestone_qb))
#
# ## Unmix
# unmix_res <- unmix(spectral_data_qb, em)
#
# unmix_res
#
# plot(unmix_res$fractions[1,] ~ attribute(spectral_data_qb)$LAI, type = "l",
# xlab = "LAI", ylab = "Unmixed fraction of vegetation")
# ## End(Not run)
Run the code above in your browser using DataLab