plotscores: Plotting PCA, PLS or OPLS model scores

Description Usage Arguments Details Value Author(s) References See Also

View source: R/plotscores.R

Description

Function for plotting PCA, PLS or OPLS model scores.

Usage

1
2
plotscores(model, pc = c(1, 2), an, title = "", qc = NA,
  legend = "in", cv.scores = T, ...)

Arguments

model

PCA, PLS or OPLS model of the package MetaboMate.

pc

Specifies which model components should be plotted on abscissa and ordinate (see Details).

an

Colour and label specification (see Details).

title

Plot title.

qc

Row indices of QC samples. Can be left NA, however, if specified QC samples will be highlighted in the plot.

legend

Position of the plot legend, set to NA if legend should be outside of the plotting area.

cv.scores

Logical value (TRUE or FALSE) indicating if cross-validated scores should be plotted for the predictive component(s) (only for PLS and O-PLS).

...

Additional values passed on to scale_colour_gradientn.

Details

Scores colouring is specified with the argument an, which is a list of three elements. The first list element specifies the colour (class factor required for categorical variables), the second list element specifies a point labeling (class character or factor) and the third list element specifies point shape. The Hotelling's T2 ellipse is automatically included and calculated for the dimensions selected by the pc argument.

Value

This function returns a ggplot2 plot object.

Author(s)

Torben Kimhofer tkimhofer@gmail.com

References

Trygg J. and Wold, S. (2002) Orthogonal projections to latent structures (O-PLS). Journal of Chemometrics, 16.3, 119-128.

Hotelling, H. (1931) The generalization of Student’s ratio. Ann. Math. Stat., 2, 360-378.

See Also

pca opls PCA_MetaboMate-class OPLS_MetaboMate-class


kimsche/MetaboMate documentation built on Aug. 8, 2020, 1:14 a.m.