# # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- P = as.matrix( rbind( c(0,4,9,6,5), c(4,0,1,8,7), c(9,1,0,3,2), c(6,8,3,0,1), c(5,7,2,1,0) ) ) #hclust( P, method="single", members=c(1,1,1,1,1) ) library(cluster) c = agnes( P, diss=T, method="single" ) hc = as.hclust( c ) postscript("../../WriteUp/Graphics/Chapter13/prob_10_single_link.eps", onefile=FALSE, horizontal=FALSE) plot( hc ) dev.off() c = agnes( P, diss=T, method="complete" ) hc = as.hclust( c ) postscript("../../WriteUp/Graphics/Chapter13/prob_10_complete_link.eps", onefile=FALSE, horizontal=FALSE) plot( hc ) dev.off()