Hi,

I know the following code can show the dendrogram. But I also want to
plot the points on a figure and have circles (or boxes) around the
points in a cluster (see
http://www.autonlab.org/tutorials/kmeans11.pdf for some examples). I
am wondering how to do so in R.

Regards,
Peng

x1 = c(0,0)
x2 = c(1,0)
x3 = c(.2,2)
x4 = c(.8,2)
png('hclust_complete.png')
plot(hclust(dist(rbind(x1,x2,x3,x4)),method = 'complete'))
dev.off()

png('hclust_average.png')
plot(hclust(dist(rbind(x1,x2,x3,x4)),method = 'average'))
dev.off()

______________________________________________
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