fviz_pca_ind
支持数据子集
select.ind
参数:
select.ind
a selection of individuals/variables to be drawn. Allowed values are NULL or a list containing the arguments name, cos2 or contrib:
name: is a character vector containing individuals/variables to be drawn
cos2: if cos2 is in [0, 1], ex: 0.6, then individuals/variables with a cos2 > 0.6 are drawn. if cos2 > 1, ex: 5, then the top 5 individuals/variables with the highest cos2 are drawn.
contrib: if contrib > 1, ex: 5, then the top 5 individuals/variables with the highest cos2 are drawn
无法直接指定
setosa
,但您可以指定
刚毛
排。
setosa_indices <- rownames(iris[iris$Species == "setosa",])
fviz_pca_ind(res.pca, label = "none",
habillage = iris$Species,
select.ind = list(name = setosa_indices))
结果是: