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
网友评论