plotPCA-methods: Ploting PCA

Description Usage Arguments Value See Also Examples

Description

Methdo to draw a plot for PCA contained in an ExposomePCA

Usage

1
2
3
4
5
6
7
8
9
plotPCA(
  object,
  set,
  cmpX = 1,
  cmpY = 2,
  show.exposures = FALSE,
  show.samples = FALSE,
  phenotype
)

Arguments

object

An onbject of class ExposomePCA

set

Group ("all", "samples" or "exposures") taht will be ploted.

cmpX

(default: 1) component to be placed at X axis

cmpY

(default: 2) component to be placed at Y axis

show.exposures

(default: FALSE) If set to true, labels indicating the exposures are shown.

show.samples

(default: FALSE) If set to true, labels indicating the samples are shown.

phenotype

If set is set to "samples" can be used to color samples by phenotype

Value

An object of class ggplot or an object of class gtable if argument set was set to "all".

See Also

pca to compite PCA on an ExposomeSet, plotPCA to plot the PCA, ExposomePCA as main class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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")

rexposome documentation built on March 13, 2021, 2:01 a.m.