Learn R Programming

ChemoSpec (version 3.0-1)

plotScree: Scree Plots of PCA Results for a Spectra Object

Description

Functions to draw a traditional scree plot or an alternative that is perhaps more useful. These illustrate the importance of the components in a PCA analysis.

Usage

plotScree(pca, ...)
plotScree2(pca, ...)

Arguments

pca
An object of class prcomp, modified to include a list element called $method, a character string describing the pre-processing carried out and the type of PCA performed (it appears on the plot).
...
Additional parameters to be passed to plotting functions.

Value

  • None. Side effect is a plot.

Details

If you add $method to the PCA results from other packages, this will plot a scree plot for any PCA results, not just those from "Spectra" objects.

References

https://github.com/bryanhanson/ChemoSpec The idea for the alternative style plot came from the NIR-Quimiometria blog by jrcuesta, at http://http://www.r-bloggers.com/pca-for-nir-spectra_part-004-projections/

Examples

Run this code
data(SrE.IR)
results <- classPCA(SrE.IR, choice = "noscale")
myt <- expression(bolditalic(Serenoa)~bolditalic(repens)~bold(IR~Spectra))
plotScree(results, main = myt)
plotScree2(results, main = myt)

Run the code above in your browser using DataLab