我无法完全弄清楚这将如何产生有用的结果,但无论如何都可以。这些名称不是该函数允许您通过参数设置抑制的东西,至少在我阅读代码和帮助页面时是这样。因此,查看代码看起来好像因子的标签是从 prcomp 对象的 $rotations 元素中提取的。尝试将这些名称全部设置为空白字符会产生错误,因此我通过设置不同长度的空白值来成功。
data(wine) # need a reproducible example so use the help page
wine.pca <- prcomp(wine, scale. = TRUE)
print(ggbiplot(wine.pca, obs.scale = 1, var.scale = 1, groups = wine.class, ellipse = TRUE, circle = TRUE))
# that was the equivalent of your plot
# Now change the input value
dimnames(wine.pca$rotation)[[1]] <-
Reduce(function(x,y) paste0(x,y), # function to concatentate the lanks
rep(" ",dim(wine.pca$rotation)[1]), # corrrect number of blanks
acc=TRUE) # save all intermediate strings
print(ggbiplot(wine.pca, obs.scale = 1, var.scale = 1, groups = wine.class,
ellipse = TRUE, circle = TRUE))
#Look, Ma! No labels