首页 > 解决方案 > 如何避免变量和个体在双图中重叠?

问题描述

我不知道如何避免箭头将个人隐藏在我的 PCA 中 ...

我使用了 repel 功能如下:

fviz_pca_biplot(res.pca, repel = TRUE,
                col.var = "#2E9FDF",
                col.ind = "#696969")

谢谢

标签: rpca

解决方案


您可以通过使用渐变颜色来最小化效果。

library(FactoMineR)
library(factoextra)
data(decathlon)

res.pca = PCA(decathlon[,1:12], scale.unit=TRUE, ncp=5, quanti.sup=c(11: 12), graph=T)

fviz_pca_biplot(res.pca, repel = TRUE, col.ind = "cos2",
                gradient.cols = c("#00AFBB", "#E7B800", "#FC4E07"),
                col.var = "#2E9FDF")


推荐阅读