x <- 1:5 %>%
dist() %>%
hclust() %>%
as.dendrogram()
y <- set(x, "labels", 5:1)
dist.dendlist(dendlist(x1 = x, x2 = x, y1 = y))
dend_diff(x, y)
# Larger trees
x <- 1:6 %>%
dist() %>%
hclust() %>%
as.dendrogram()
y <- set(x, "labels", c(1:3, 6, 4, 5))
dend_diff(x, y)
dist.dendlist(dendlist(x, y))
distinct_edges(x, y)
distinct_edges(y, x)
length(distinct_edges(x, y)) + length(distinct_edges(y, x)) # dist.dendlist
Run the code above in your browser using DataLab