| plotPCA | R Documentation |
Methdo to draw a plot for PCA contained in an ExposomePCA
plotPCA( object, set, cmpX = 1, cmpY = 2, show.exposures = FALSE, show.samples = FALSE, phenotype )
object |
An onbject of class ExposomePCA |
set |
Group ( |
cmpX |
(default: |
cmpY |
(default: |
show.exposures |
(default: |
show.samples |
(default: |
phenotype |
If |
An object of class ggplot or an object of class
gtable if argument set was set to "all".
pca to compite PCA on an ExposomeSet, plotPCA to plot the PCA, ExposomePCA as main class
data("exposome")
epca <- pca(expo[3:7, 1:100])
# A grid with exposures space, samples space and explained variance
plotPCA(epca, set = "all")
# Only exposures space
plotPCA(epca, set = "exposures") + ggplot2::theme(legend.position = "bottom")
# Only samples space
plotPCA(epca, set = "samples")
# Only samples space but coloured by phenotype
plotPCA(epca, set = "samples", phenotype = "sex") +
ggplot2::theme(legend.position = "bottom")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.