Single PCA plot function

plotPCAbiplot(
  prcomp,
  loading = FALSE,
  n_loadings = 10,
  dims = c(1, 2),
  group_by = NULL
)

Arguments

prcomp

prcomp object generated by stats::prcomp()

loading

logical, if to plot and label loadings of PCA, default 'FALSE'

n_loadings

num, top n loadings to plot; or a vector of gene IDs; only work when loading = TRUE

dims

a vector of 2 elements, specifying PCs to plot

group_by

character, specify the column to be grouped and colored, default NULL

Value

ggplot of PCA