View source: R/map.spectra.gradient.R
map.spectra.gradient | R Documentation |
Colors and plots each spectra based on the associated concentration of the outcome variable
map.spectra.gradient(
xblock = NULL,
yblock = NULL,
legend.title = "Gradient",
plot.title = "Spectra with gradient based on Y variable",
xlab = "Wavelength",
ylab = "Absorbance",
grad = 10,
l.width = 0.75,
col.legend = NULL
)
xblock |
A matrix containing one spectra for each observation. |
yblock |
A vector containing the concentration associated to each spectra in the xblock matrix. |
legend.title |
Title of the legend which displays the gradient. |
plot.title |
Title of the plot. |
xlab |
Title of the x axis. |
ylab |
Title of the y axis. |
grad |
Number of colors for the gradient's palette. |
l.width |
Width of each spectra. |
col.legend |
Deletes presence of the legend. |
Plot with spectra of all observations, mapped with the intensity of the associated concentration.
data(beer)
X=beer[,2:ncol(beer)]
names(X)=convert.names.wl(1100,2250,2)
Y=unlist(beer[,1])
map.spectra.gradient(X,Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.