Using the following matrix of distances between 6 Italian cities:
0 662 877 255 412 996
662 0 295 468 268 400
877 295 0 754 564 138
255 468 754 0 219 869
412 268 564 219 0 669
996 400 138 869 669 0
Will R output the order of which it clustered them in: For example, single-linkage would tell you:
City 3 and City 6, followed by
City 4 and City 5, followed by
City 1 to City 4 and City 5, finally City 2 to City 3 and City 6.
It is important that I get a numeric output rather than read it off a dendrogram.
I don't know a complete solution for your problem but maybe you could use the
merge
value returned byhclust
.From
?hclust
:Your example: