Learn R Programming

dendextend (version 1.4.0)

dend_diff: Plots two trees side by side, highlighting edges unique to each tree in red.

Description

Plots two trees side by side, highlighting edges unique to each tree in red.

Usage

dend_diff(dend, ...)
"dend_diff"(dend, dend2, horiz = TRUE, ...) "dend_diff"(dend, ..., which)

Arguments

dend
a dendrogram or dendlist to compre with
...
passed to plot.dendrogram
dend2
a dendrogram to compare with
horiz
logical (TRUE) indicating if the dendrogram should be drawn horizontally or not.
which
an integer vector indicating, in the case "dend" is a dendlist, on which of the trees should the modification be performed. If missing - the change will be performed on all of objects in the dendlist.

Value

Invisible dendlist of both trees.

Source

A dendrogram implementation for phylo.diff from the distory package

See Also

distinct_edges, highlight_distinct_edges, dist.dendlist, tanglegram assign_values_to_branches_edgePar, distinct.edges,

Examples

Run this code

x <- 1:5 %>% dist %>% hclust %>% as.dendrogram
y <- set(x, "labels", 5:1)

dend_diff(x, y)
dend_diff(dendlist(x, y))
dend_diff(dendlist(y, x))

dend1 <- 1:10 %>% dist %>% hclust %>% as.dendrogram
dend2 <- dend1 %>% set("labels", c(1,3,2,4, 5:10) )
dend_diff(dend1, dend2)

Run the code above in your browser using DataLab