How to display the row name in K means cluster plot in R?
问题 I am trying to plot the K-means cluster. The below is the code i use. library(cluster) library(fpc) data(iris) dat <- iris[, -5] # without known classification # Kmeans clustre analysis clus <- kmeans(dat, centers=3) clusplot(dat, clus$cluster, color=TRUE, shade=TRUE, labels=2, lines=0) I get the below picture: Instead of the row numbers, I want it displayed with a row name in characters. I understand this picture is producing had the data like the below: Sepal.Length Sepal.Width Petal.Length