Skip to contents

Draw a PCA scores plot. Currently supported data types:

Usage

plot_pca(x, type = "individual", groups = NULL, group_col = NULL, ...)

# S3 method for class 'glystats_pca_res'
plot_pca(x, type = "individual", groups = NULL, group_col = NULL, ...)

# S3 method for class 'glyexp_experiment'
plot_pca(
  x,
  type = "individual",
  groups = NULL,
  group_col = NULL,
  stats_args = list(),
  ...
)

Arguments

x

An object to be plotted.

type

The type of plot, one of "screeplot", "individual", "variables", or "biplot".

groups

A factor or character vector specifying group membership for each sample. If provided, the plot will be colored by group. Only applicable to "individual" and "biplot" types. Passed to the habillage paramter of factoextra::fviz_pca_ind() or factoextra::fviz_pca_biplot().

group_col

A character string specifying where to find the group information.

...

Additional arguments passed to underlying factoextra functions:

stats_args

A list of keyword arguments to pass to glystats::gly_pca().

Value

A ggplot object.