# NOT RUN {
# }
# NOT RUN {
dend1 <- USArrests[1:10, ] %>%
dist() %>%
hclust() %>%
as.dendrogram()
set.seed(3525)
dend2 <- shuffle(dend1)
tanglegram(dend1, dend2)
entanglement(dend1, dend2, L = 2) # 0.4727
dend2_corrected <- untangle_step_rotate_1side(dend2, dend1)[[1]]
tanglegram(dend1, dend2_corrected) # FIXED.
entanglement(dend1, dend2_corrected, L = 2) # 0
# }
Run the code above in your browser using DataLab