R ggbiplot group option

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,


# The simplest and most handsome example
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')

Not an answer but a note on this:
It seems "ggbiplot" wasn't updated in ages, I cannot even install it for my R-version.
As you are just learning this you may start with a package that is more up-to-date, e.g. the "factoextra" package.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.