powered by
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 )
Plot with spectra of all observations, mapped with the intensity of the associated concentration.
A matrix containing one spectra for each observation.
A vector containing the concentration associated to each spectra in the xblock matrix.
Title of the legend which displays the gradient.
Title of the plot.
Title of the x axis.
Title of the y axis.
Number of colors for the gradient's palette.
Width of each spectra.
Deletes presence of the legend.
data(beer) X=beer[,2:ncol(beer)] names(X)=convert.names.wl(1100,2250,2) Y=unlist(beer[,1]) map.spectra.gradient(X,Y)
Run the code above in your browser using DataLab