Learn R Programming

ChemoSpec (version 2.0-2)

plotScoresRGL: Interactive 3D Score Plot of a Spectra Object

Description

This function uses the rgl package to create an interactive plot of PCA scores derived from a "Spectra" object. A title and legend can be added if desired. Classical or robust confidence ellipses may be added if desired.

Usage

plotScoresRGL(spectra, pca, pcs = c(1:3), ellipse = TRUE,
	rob = FALSE, cl = 0.95, frac.pts.used = 0.8,
	title = NULL, t.pos = NULL, leg.pos = NULL, lab.opts = FALSE,
	tol = 0.01, use.sym = FALSE, ...)

Arguments

Value

None. Side effect is a plot

Details

If you intend to make a hard copy of your plot, use lab.opts = TRUE until you have found a good view of your data. Then note corners of the cube where the title and legend won't interfere with viewing the data, and use these as arguments for t.pos and leg.pos, and add title. Adjust as necessary, then turn off label display using lab.opts = FALSE. Back at the console, use > rgl.snapshot("file_name.png") to create the hardcopy.

References

http://academic.depauw.edu/~hanson/ChemoSpec/ChemoSpec.html

See Also

Other functions in ChemoSpec that plot PCA scores are: plotScores (2D version), and plotScores3D (uses lattice graphics).

Examples

Run this code
data(CuticleIR)
results <- classPCA(CuticleIR, choice = "autoscale")
plotScoresRGL(CuticleIR, results, title = "Cuticle IR Spectra",
leg.pos = "A", t.pos = "B")

Run the code above in your browser using DataLab