plot_PCA {BioNERO} | R Documentation |
Plot Principal Component Analysis (PCA) of samples
plot_PCA(exp, metadata, log_trans = FALSE, PCs = "1x2", size = 2)
exp |
A gene expression data frame with genes in row names and samples in column names or a 'SummarizedExperiment' object. |
metadata |
A data frame containing sample names in row names and sample annotation in the first column. Ignored if 'exp' is a 'SummarizedExperiment' object, since the function will extract colData. |
log_trans |
Logical. If TRUE, the expression data frame will be log transformed with log2(exp+1). |
PCs |
Principal components to be plotted on the x-axis and y-axis, respectively. One of "1x2", "1x3" or "2x3. Default is "1x2". |
size |
Numeric indicating the point size. Default is 2. |
A ggplot object with the PCA plot.
Fabricio Almeida-Silva
data(zma.se) plot_PCA(zma.se, log_trans = TRUE)