问题描述
如何绘制使用 prcomp 后的第二和第三主成分。
我最感兴趣的变量的第二和第三主成分解释了更多的方差。
这是我用于第 1 次和第 2 次的代码。
res.pca <- prcomp(data3,scale = TRUE)
fviz_eig(res.pca)
fviz_pca_ind(res.pca,col.ind = "cos2",# Color by the quality of representation
gradient.cols = c("#00AFBB","#E7B800","#FC4E07"),repel = TRUE # Avoid text overlapping
)