## Not run:
# data(spectral_data)
#
# ## Calculate all possible combinations for WorldView-2-8
# spec_WV <- spectralResampling(spectral_data, "WorldView2-8",
# response_function = FALSE)
# nri_WV <- nri(spec_WV, recursive = TRUE)
#
# ## Fit generalised linear models between NRI-values and chlorophyll
# glmnri <- glm.nri(nri_WV ~ chlorophyll, preddata = spec_WV)
#
# ## Plot p-values
# plot(glmnri, range = c(0, 0.05))
# ## Plot t-values
# plot(glmnri, coefficient = "t.value")
# ## Plot only t-values where p-values < 0.001
# plot(glmnri, coefficient = "t.value",
# constraint = "p.value < 0.001")
#
# ## Fit linear models between NRI-values and chlorophyll
# lmnri <- lm.nri(nri_WV ~ chlorophyll, preddata = spec_WV)
#
# ## Plot r.squared
# plot(lmnri)
#
# ## Example for EnMAP (Attention: Calculation time may be long!)
# spec_EM <- spectralResampling(spectral_data, "EnMAP",
# response_function = FALSE)
# mask(spec_EM) <- c(300, 550, 800, 2500)
# nri_EM <- nri(spec_EM, recursive = TRUE)
# glmnri <- glm.nri(nri_EM ~ chlorophyll, preddata = spec_EM)
#
# ## Plot T values in lower and p-values in upper diagonal
# ## of the plot
# ## Enlarge margins for legends
# par(mar = c(5.1, 4.1, 4.1, 5))
# plot(glmnri, coefficient = "t.value", legend = "outer")
# plot(glmnri, coefficient = "p.value", uppertriang = TRUE)
# lines(c(400,1705),c(400,1705))
# ## End(Not run)
Run the code above in your browser using DataLab