ggpca | R Documentation |
Create an eigenvectors scatterplot from principal component analysis.
ggpca( data, group_var = NULL, pc_x = 1, pc_y = 2, ntop = nrow(data), center = T, scale = T, equal_axes = F, point_size = 3, alpha = 0.75, color = "red4", palette = "Paired", return_data = F )
data |
A SummarizedExperiment-like object. Must be compatible with |
group_var |
A string or vector of strings for the grouping variable(s) to use from
|
pc_x |
A numeric. The PC to plot on the x-axis. |
pc_y |
A numeric. The PC to plot on the y-axis. |
ntop |
A numeric. Specifies the top |
center |
A logical. Should the data be zero-centered prior to PCA? |
scale |
A logical. Should the data be scaled to unit variance prior to PCA? |
equal_axes |
A logical. Should the scatterplot use the same axis limits for both axes? |
point_size |
A numeric for the plot point size. |
alpha |
A numeric for the plot point alpha level. |
color |
A string for the color of plot points. Only used when |
palette |
A string for the RColorBrewer palette name to use when |
return_data |
A logical. Should plot data be returned instead of a ggplot object? |
Conducts a principal component analysis (PCA) then produces a scatterplot using the user-specified eigenvectors (ie., principal components or PCs) from the eigenvector matrix. Data points can be optionally color-coded based on a user-specified variable.
A ggplot object unless return_data
is TRUE
, then a data frame with the
user-specified PCs, grouping variable, and an attribute for the percent variace explained for
each user-specified PC.
prcomp
SummarizedExperiment
assay
colData
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.