首页 > 解决方案 > ggbiplot 以前与 prcomp 一起工作,现在不会

问题描述

ggbiplot以前使用没有问题,prcomp但现在没有。我收到的只是以下错误代码:

plot_label 中的错误(p = p,数据 = plot.data,label = label,label.label = label.label,:不支持的类:prcomp

我已经安装了ggbiplotusingdependencies=TRUE以及其他关于类似问题的所有其他帖子,但我仍然收到此消息。

任何帮助表示赞赏。

mypca <- prcomp(mydata, center=TRUE, scale.=TRUE)
ggbiplot(mypca, center=TRUE, scale.=TRUE)

plot_label 中的错误(p = p,数据 = plot.data,label = label,label.label = label.label,:不支持的类:prcomp

标签: rggbiplotprcomp

解决方案


我不认为ggbiplot有一个centerscale.论点。您是否prcompggbiplot函数参数感到困惑?

以下工作正常:

library(ggbiplot)
pca <- prcomp(USArrests, center = TRUE, scale. = TRUE)
ggbiplot(pca)

在此处输入图像描述

经测试ggbiplot_0.55


推荐阅读