mclustSpectra: mclust Analysis of a Spectra Object PCA Results

Description Usage Arguments Value Author(s) See Also Examples

View source: R/mclustSpectra.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
mclustSpectra(
  spectra,
  pca,
  pcs = c(1:3),
  dims = c(1, 2),
  plot = c("BIC", "proj", "errors"),
  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.

Author(s)

Bryan A. Hanson (DePauw University)

See Also

Mclust for background on the method. Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
require("mclust")
data(metMUD1)
cls <- c_pcaSpectra(metMUD1, choice = "autoscale")

p <- plotScores(metMUD1, cls)

mclustSpectra(metMUD1, cls, plot = "BIC")
mclustSpectra(metMUD1, cls, plot = "proj")
mclustSpectra(metMUD1, cls, plot = "errors", truth = metMUD1$groups)

## End(Not run)

bryanhanson/ChemoSpec documentation built on Jan. 9, 2022, 6:41 p.m.