plot3dScores: 3D PCA Score Plot for a Spectra Object

View source: R/plot3dScores.R

plot3dScoresR Documentation

3D PCA Score Plot for a Spectra Object

Description

Creates an interactive 3D plot of PCA scores from the analysis of a Spectra object, color coded according the to scheme stored in the object. The plot is created by plotly and appears in a browser window.

Usage

plot3dScores(
  spectra,
  pca,
  pcs = c(1:3),
  ellipse = TRUE,
  rob = FALSE,
  cl = 0.95,
  frac.pts.used = 0.8
)

Arguments

spectra

An object of S3 class Spectra.

pca

An object of class prcomp.

pcs

A vector of three integers specifying the PCA scores to plot.

ellipse

Logical indicating if confidence ellipses should be drawn.

rob

Logical; if ellipse = TRUE, indicates that robust confidence ellipses should be drawn. If FALSE, classical confidence ellipses are drawn.

cl

A number indicating the confidence interval for the ellipse.

frac.pts.used

If ellipse = TRUE and rob = TRUE, a number indicating the fraction of the data points to be considered "good" and thus used to compute the robust confidence ellipse.

Value

None. Side effect is a plot in a browser window.

Author(s)

Bryan A. Hanson (DePauw University)

See Also

Additional documentation at https://bryanhanson.github.io/ChemoSpec/

Examples

if (interactive()) {
  data(metMUD1)
  pca <- c_pcaSpectra(metMUD1, choice = "noscale")
  p <- plot3dScores(metMUD1, pca)
  p
}


bryanhanson/ChemoSpec documentation built on March 24, 2022, 3:26 a.m.