Thank you Peter for your help. I had tried hclust before but I made the mistake of using the D matrix above instead of a dist object. Hence
library(flashClust) d <- as.dist(D) # Clustering using hclust hc <- hclust(d, method = "median",members=NULL) # Clustering using flashClust fc <- flashClust(d,method="median",members=NULL) solves the problem I posted. But another question arises. How is the median linkage calculated? I want it to be like this: Given clusters C1=(1,2,3) and C2=(4), the distance between C1 and C2 is: d(C1,C2) = median(d(1,4),d(2,4),d(3,4)) = median(0.2, 1.0, 0.8) = 0.8, where the values d(1,4), d(2,4) and d(3,4) are taken from the D matrix above. If this is not the case, is there any function that uses this linkage metric? Thanks Henrik -- View this message in context: http://r.789695.n4.nabble.com/hcluster-with-linkage-median-tp2715585p2716728.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.