Generate a tanglegram from two hierarchical clusterings of a data set
Generate a tanglegram from two hierarchical clusterings of a data set
This function generates a tanglegram of two different hierarchical clusterings of the same dataset. This is essentially a convenience wrapper for the function tanglegram in the package dendextend; see Galili (2015).
tangle(hc0, hc1)
Arguments
hc0: An object that can be coerced to a dendrogram, e.g., an object from hclust. This object will be plotted on the left side of the tanglegram.
hc1: An object that can be coerced to a dendrogram, e.g., an object from hclust. This object will be plotted on the right side of the tanglegram.
Details
This function is a convenience wrapper for the function tanglegram in the R package dendextend; see http://cran.at.r-project.org/web/packages/dendextend/. A tanglegram is used to visualize the similarities and differences between two different hierarchical clusterings of the same dataset.
Returns
An invisible dendlist, with two trees after being modified during the creation of the tanglegram
al Galili (2015). dendextend: an R package for visualizing, adjusting, and comparing trees of hierarchical clustering. Bioinformatics. doi:10.1093/bioinformatics/btv428
See Also
tanglegram
Examples
##---- Should be DIRECTLY executable !! ----##-- ==> Define data, use random,##-- or do help(data=index) for the standard data sets.## The function is currently defined asfunction(hc0, hc1){ hcd0 <- as.dendrogram(hc0) hcd1 <- as.dendrogram(hc1) hcd0 <- match_order_by_labels(hcd0, hcd1) dends_0_1 <- dendlist(hcd0, hcd1) t <- tanglegram(dends_0_1) t
}