| plot.Nri | R Documentation |
Plot values in (generalised) linear modes and correlation tests from narrow band indices
## S4 method for signature 'Nri'
plot(x, coefficient = "p.value", predictor = 2,
xlab = "Wavelength band 1 (nm)",
ylab = "Wavelength band 2 (nm)", legend = TRUE,
colspace = "hcl", col = c(10, 90, 60, 60, 10, 80),
digits = 2, range = "auto", constraint = NULL,
uppertriang = FALSE, zlog = FALSE, ...)
x |
Object to be plotted. |
coefficient |
Name or index of coefficient to plot. |
predictor |
Name or index of term to plot. |
xlab |
Label for x-axis. |
ylab |
Label for y-axis. |
legend |
Flag if legend is plotted. If |
colspace |
Either "hcl" or "rgb". Colour space to be used for the plots. |
col |
If colspace == "hcl", the vector is giving the minimum and maximum values of hue (element 1 & 2), chroma (element 3 & 4) and luminance (element 5 & 6). The optional element 7 is used as alpha value. See |
digits |
Precision of labels in legend. |
range |
"auto" or a vector of length = 2 giving the range of values to be plotted. |
constraint |
A character string giving a constraint which values should be plotted. See examples section. |
uppertriang |
Flag if upper triangle is used for the plot. Note that if |
zlog |
Flag indicating if color should be logarithmically scaled. Useful e.g. for p-values. |
... |
Further arguments passed to |
See details in glm.nri and glm.
An invisible vector with minimum and maximum values plotted.
Lukas Lehnert
nri, glm.nri, glm, cor.test, t.test
## 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, zlog = TRUE)
lines(c(400,1705),c(400,1705))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.