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 <lastsum...@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]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to