I used k-means cluster algorithm on a data-frame df1 and the result is shown in the picture below.
library(ade4)
df1 <- data.frame(x=runif(100), y=runif(100))
plot(df1)
km <- kmeans(df1, centers=3)
kmeansRes<-factor(km$cluster)
s.class(df1,fac=kmeansRes, add.plot=TRUE, col=rainbow(nlevels(kmeansRes)))
Is there a possibility to add to the data frame information from which cluster does the observation come from?