I am trying to (partially) reproduce the cluster graph available via t s.class(...) in ade4 package with ggplot , but this question is actually much more general.
NB: This question refers to "starry plots," but only the spider graphics are actually discussed.
df <- mtcars[,c(1,3,4,5,6,7)] pca <-prcomp(df, scale.=T, retx=T) scores <-data.frame(pca$x) library(ade4) km <- kmeans(df,centers=3) plot.df <- cbind(scores$PC1, scores$PC2) s.class(plot.df, factor(km$cluster))

An important feature I'm looking for is a "star", for example. a set of lines starting from a common point (here, the centroids of the cluster), to a number of other points (here are points in the cluster).
Is there a way to do this with the ggplot package? If not directly through ggplot , then does anyone know about an add-in that works. For example, there are several stat_ellipse(...) options that are not part of the ggplot package ( here , but here ).
source share