Question: I have two dendrograms which I wish to compare to each other in order to find out how "similar" they are. But I don't know of any method to do so (let alone a code to implement it, say, in R).

Any leads ?

**UPDATE** (2014-09-13):

Since asking this question, I have written an R package called [dendextend](http://cran.r-project.org/web/packages/dendextend/), for the visualization, manipulation and **comparison** of dendrogram. This package is on [CRAN](http://cran.r-project.org/web/packages/dendextend/) and comes with a [detailed vignette](http://cran.r-project.org/web/packages/dendextend/vignettes/introduction.html). It includes functions such as `cor_cophenetic`, `cor_bakers_gamma` and `Bk` / `Bk_plot`. As well as a `tanglegram` function for visually comparing two trees.

Answer: 
As you know, [Dendrograms](https://www.centerspace.net/drawing-dendrograms) arise from hierarchical clustering - so what you are really asking is how can I compare the results of two hierarchical clustering runs. There are no standard metrics I know of, but I would be looking at the number of clusters found and comparing membership similarity between like clusters. [Here](http://www.centerspace.net/clustering-analysis-part-iii-hierarchical-cluster-analysis) is a good overview of hierarchical clustering that my colleague wrote on clustering scotch whiskey's.
There is a rich body of literature for tree distance metrics in the phylogenetics community that seems to have been neglected from the computer science perspective. See [`dist.topo`](http://www.inside-r.org/packages/cran/ape/docs/dist.topo) of the `ape` package for two tree distance metrics and several citations (Penny and Hardy 1985, Kuhner and Felsenstein 1994) which considering the similarity of tree partitions, and also the [Robinson-Foulds metric](https://en.wikipedia.org/wiki/Robinson%E2%80%93Foulds_metric) which has an R implementation in the [`phangorn`](http://www.inside-r.org/packages/cran/phangorn/docs/treedist) package.

One problem is that these metrics don't have a fixed scale, so they are only useful in the cases of 1) tree comparison or 2) comparison to some generated baseline, perhaps via [permutation tests similar to what Tal has done with Baker's Gamma](https://cran.r-project.org/web/packages/dendextend/vignettes/introduction.html#correlation-measures) in his fantastic dendextend package.

If you have hclust or dendrogram objects generated from `R` hierarchical clustering, using `as.phylo` from the `ape` package will convert your dendrograms to phylogenetic trees for usage in these functions.