R 语言 PCA画图

画PCA
输入矩阵,分组



可以多个分组

dat=as.data.frame(t(exp))
library(FactoMineR)
library(factoextra) 
dat.pca <- PCA(dat, graph = FALSE)
fviz_pca_ind(dat.pca,
             geom.ind = "point", # show points only (nbut not "text")
             col.ind = group_list, # color by groups
             addEllipses = TRUE, # Concentration ellipses
             legend.title = "Groups"
)

ggsave('all_samples_PCA.png')

你可能感兴趣的:(R 语言 PCA画图)