Hello! I 'm new to R and need your help in one question... I did cluster analysis using kmeans function. I load data from file: This file also contains headers for objects I want to cluster. After making a clustering procedure I display result on plot: And it shows only points (i.e. objects) without their names. Is there any way to mark points on this plot with their names from file? Your help would be very appreciated! Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Result-of-clustering-on-plot-tp4625043.html Sent from the R help mailing list archive at Nabble.com.
You don't give much information about x, but assuming that the "names" you want to add to the plot are the row names. Try this text(x, col=cl$cluster, rownames(x)) Jean greyofthedawn <lastsummer@bigmir.net> wrote on 05/10/2012 06:46:05 PM:> Hello! I 'm new to R and need your help in one question... > I did cluster analysis using kmeans function. I load data from file: > x <- read.table('C:\\tpoints.txt', sep=',', header=TRUE) > This file also contains headers for objects I want to cluster. > After making a clustering procedure I display result on plot: > plot(x,col=km$cluster, pch = 16) > And it shows only points (i.e. objects) without their names. > Is there any way to mark points on this plot with their names from file? > Your help would be very appreciated! Thank you![[alternative HTML version deleted]]
Yes, now it works! Thank you very much for your help! Jane -- View this message in context: http://r.789695.n4.nabble.com/Result-of-clustering-on-plot-tp4625043p4627431.html Sent from the R help mailing list archive at Nabble.com.