pcascree: Scree plot of the PCA on the samples

View source: R/pcaplot.R

pcascreeR Documentation

Scree plot of the PCA on the samples

Description

Produces a scree plot for investigating the proportion of explained variance, or alternatively the cumulative value

Usage

pcascree(obj, type = c("pev", "cev"), pc_nr = NULL, title = NULL)

Arguments

obj

A prcomp object

type

Display absolute proportions or cumulative proportion. Possible values: "pev" or "cev"

pc_nr

How many principal components to display max

title

Title of the plot

Value

An object created by ggplot, which can be assigned and further customized.

Examples

dds <- makeExampleDESeqDataSet_multifac(betaSD_condition = 3, betaSD_tissue = 1)
rlt <- DESeq2::rlogTransformation(dds)
pcaobj <- prcomp(t(SummarizedExperiment::assay(rlt)))
pcascree(pcaobj, type = "pev")
pcascree(pcaobj, type = "cev", title = "Cumulative explained proportion of variance - Test dataset")


federicomarini/pcaExplorer documentation built on Sept. 29, 2024, 9:31 p.m.