R - tips

pca 椭圆 ggplot

2020-02-23  本文已影响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
上一篇 下一篇

猜你喜欢

热点阅读