Hello guys,
I'm learning ggbiplot to draw PCA analysis plot. below is the sample code. in the plot part, there is " groups = wine.class" option in here, but I can not find the variable in wine dataframe. Can you help me to understand this 'variable' , where it comes from and how to associate with the wind dataframe (row by row)?
Many thanks,
Kai
library(ggbiplot)
# The simplest and most handsome example
data(wine)
wine
wine.pca <- prcomp(wine, scale. = TRUE)
# Demo Style
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1,
groups = wine.class, ellipse = TRUE, circle = TRUE) +
scale_color_discrete(name = '') +
theme(legend.direction = 'horizontal', legend.position = 'top')