美文网首页R - tips
pca 椭圆 ggplot

pca 椭圆 ggplot

作者: 董八七 | 来源:发表于2020-02-23 12:13 被阅读0次

from Plotting PCA (Principal Component Analysis)

library(tidyverse)
library(ggfortify)
library(ggthemes)

df <- iris[c(1, 2, 3, 4)]
autoplot(prcomp(df), data = iris, colour = 'Species', frame = TRUE, frame.type = 'norm')+
  geom_vline(xintercept = c(0), linetype="dashed")+
  geom_hline(yintercept = c(0), linetype="dashed")+
  theme_base()
pca

相关文章

网友评论

    本文标题:pca 椭圆 ggplot

    本文链接:https://www.haomeiwen.com/subject/citjqhtx.html