set.seed(23235)
ss <- sample(1:150, 10 )
hc1 <- hclust(dist(iris[ss,-5]), "com")
hc2 <- hclust(dist(iris[ss,-5]), "single")
dend1 <- as.dendrogram(hc1)
dend2 <- as.dendrogram(hc2)
tanglegram(dend1 , dend2)
tanglegram(dend1 , dend2, sort = TRUE)
tanglegram(dend1 , dend2, remove_nodePar = TRUE)
tanglegram(dend1 , dend2, k_labels = 6, k_branches = 4)
tanglegram(dend1 , dend2, lab.cex = 2, edge.lwd = 3,
margin_inner= 5, type = "t", center = TRUE)
## works nicely:
tanglegram(dend1 , dend2, lab.cex = 2, edge.lwd = 3,
margin_inner= 3.5, type = "t", center = TRUE,
dLeaf = -0.1, xlim = c(7,0),
k_branches=3)
# using rank_branches can make the comparison even easier
tanglegram(rank_branches(dend1) , rank_branches(dend2), lab.cex = 2, edge.lwd = 3,
margin_inner= 3.5, type = "t", center = TRUE,
dLeaf = -0.1, xlim = c(5.1,0), columns_width= c(5,1,5),
k_branches=3)Run the code above in your browser using DataLab