if (FALSE) {
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)
# cutree(dend1)
cor_bakers_gamma(hc1, hc2)
cor_bakers_gamma(dend1, dend2)
dend1 <- match_order_by_labels(dend1, dend2) # if you are not sure
cor_bakers_gamma(dend1, dend2, use_labels_not_values = FALSE)
library(microbenchmark)
microbenchmark(
with_labels = cor_bakers_gamma(dend1, dend2, try_cutree_hclust = FALSE),
with_values = cor_bakers_gamma(dend1, dend2,
use_labels_not_values = FALSE, try_cutree_hclust = FALSE
),
times = 10
)
cor_bakers_gamma(dend1, dend1, use_labels_not_values = FALSE)
cor_bakers_gamma(dend1, dend1, use_labels_not_values = TRUE)
}
Run the code above in your browser using DataLab