Learn R Programming

ChemoSpec (version 3.0-1)

mclustSpectra: mclust Analysis of a Spectra Object PCA Results

Description

This function is a wrapper for the Mclust function and associated plotting functions.

Usage

mclustSpectra(spectra, pca, pcs = c(1:3), dims = c(1, 2),
	plot = c("BIC", "proj", "error"), use.sym = FALSE, ...)

Arguments

spectra
An object of S3 class "Spectra".
pca
An object of class prcomp.
pcs
An integer vector describing which PCs to use.
dims
A integer vector giving the PCA dimensions to use.
plot
A character string indicating what plot to make. Options are c("BIC", "proj", "error"); see Mclust for details.
use.sym
Logical; if true, the color scheme is changed to black and symbols are used for plotting.
...
Other parameters to be passed downstream.

Value

  • The Mclust model is returned invisibly, and a plot is made.

References

https://github.com/bryanhanson/ChemoSpec

See Also

Mclust for the underlying function.

Examples

Run this code
data(CuticleIR)
class <- classPCA(CuticleIR)
mclustSpectra(CuticleIR, class, main = "Cuticle IR", plot = "BIC")
mclustSpectra(CuticleIR, class, main = "Cuticle IR", plot = "proj")
mclustSpectra(CuticleIR, class, main = "Cuticle IR", plot = "error",
	truth = CuticleIR$groups)

Run the code above in your browser using DataLab