I saw this neat principal component analysis graph online, where they had lines connecting each cluster to a center point.
I used an example data set to show that I have made it up to adding the ellipses, but after looking online, I think this PCA package currently doesnt have the ability to add these, and in some cases, it is called as a "star". Is there a way to somehow loophole around and add this into a PCA chart?
I have added some sample code below that gets up the the part that doesn't have the lines connecting. Suggestions on this would be great please. My last thought is maybe using ggforce or something along those lines?
library(factoextra)
data(iris)
res.pca <- prcomp(iris[,-5], scale=TRUE)
fviz_pca_ind(res.pca, label="none", alpha.ind=1, pointshape=19,habillage=iris$Species, addEllipses = TRUE, ellipse.level=0.95)
Some comments have suggested these sites, but while it is close, it is a bit different since I am trying to use a data frame with one of the columns being that of the different categories I hope to use for the different clusterings.
Any possible suggestions would be much appreciated please.