Creates a basic 3D plot of PCA scores from the analysis of a
Spectra
object, color coded according the to scheme stored in
the object.
plotScores3D(spectra, pca, pcs = c(1:3), ellipse = TRUE, rob = FALSE,
cl = 0.95, frac.pts.used = 0.8, view = list(y = 34, x = 10, z = 0),
tol = 0.01, use.sym = FALSE, ...)
An object of S3 class Spectra
.
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). This is automatically provided if ChemoSpec
functions
c_pcaSpectra
or r_pcaSpectra
were used to create
pca
.
A vector of three integers specifying the PCA scores to plot.
Logical indicating if confidence ellipses should be drawn.
Logical; if ellipse = TRUE
, indicates that robust
confidence ellipses should be drawn. If FALSE
, classical confidence
ellipses are drawn.
A number indicating the confidence interval for the ellipse.
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.
A list of viewing transformations to be applied to the data.
May contain values for x, y and z axes; keep in mind that the order of the
transformations is important. For example, specifying view = list(x =
45, y = 10)
produces a different view than view = list(y = 10, x =
45)
. The list may be as along as you like - the series of transformations
representing an accumulation of tweaks to achieve the desired view.
Quantile to be used to label extreme data points. Currently not used - need to fix the code!
logical; if true, the color scheme is change to black and symbols are used for plotting.
Other parameters to be passed downstream.
None. Side effect is a plot.
For a 2D plot of the scores, see plotScores
. For
interactive 3D plots, use plotScoresRGL
. Additional documentation
at https://bryanhanson.github.io/ChemoSpec/
# NOT RUN {
data(metMUD1)
pca <- c_pcaSpectra(metMUD1, choice = "noscale")
plotScores3D(metMUD1, pca, main = "metMUD1 NMR Spectra")
# }
Run the code above in your browser using DataLab