| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/distinct_edges.R |
| 3 |
\name{highlight_distinct_edges} |
| 4 |
\alias{highlight_distinct_edges} |
| 5 |
\alias{highlight_distinct_edges.dendrogram} |
| 6 |
\alias{highlight_distinct_edges.dendlist} |
| 7 |
\title{Highlight distint edges in a tree (compared to another one)} |
| 8 |
\usage{ |
| 9 |
highlight_distinct_edges(dend, ...) |
| 10 |
|
| 11 |
\method{highlight_distinct_edges}{dendrogram}( |
| 12 |
dend, |
| 13 |
dend2, |
| 14 |
value = 2, |
| 15 |
edgePar = c("col", "lty", "lwd"), |
| 16 |
... |
| 17 |
) |
| 18 |
|
| 19 |
\method{highlight_distinct_edges}{dendlist}(dend, ..., which = c(1L, 2L)) |
| 20 |
} |
| 21 |
\arguments{ |
| 22 |
\item{dend}{a dendrogram or \link{dendlist} to find unique edges in (to highlight)} |
| 23 |
|
| 24 |
\item{...}{Ignored.} |
| 25 |
|
| 26 |
\item{dend2}{a dendrogram to compare with} |
| 27 |
|
| 28 |
\item{value}{a new value scalar for the edgePar attribute.} |
| 29 |
|
| 30 |
\item{edgePar}{a character indicating the value inside edgePar to adjust. |
| 31 |
Can be either "col", "lty", or "lwd".} |
| 32 |
|
| 33 |
\item{which}{an integer vector indicating, in the case "dend" is a dendlist, |
| 34 |
on which of the trees should the modification be performed. |
| 35 |
If missing - the change will be performed on all of objects in the dendlist.} |
| 36 |
} |
| 37 |
\value{ |
| 38 |
A dendrogram with modified edges - the distinct ones are changed (color, line width, or line type) |
| 39 |
} |
| 40 |
\description{ |
| 41 |
Highlight distint edges in a tree (compared to another one) by changing |
| 42 |
the branches' color, line width, or line type. |
| 43 |
|
| 44 |
This function enables this feature in \link{dend_diff} and \link{tanglegram} |
| 45 |
} |
| 46 |
\examples{ |
| 47 |
|
| 48 |
x <- 1:5 \%>\% |
| 49 |
dist() \%>\% |
| 50 |
hclust() \%>\% |
| 51 |
as.dendrogram() |
| 52 |
y <- set(x, "labels", 5:1) |
| 53 |
distinct_edges(x, y) |
| 54 |
distinct_edges(y, x) |
| 55 |
|
| 56 |
par(mfrow = c(1, 2)) |
| 57 |
plot(highlight_distinct_edges(x, y)) |
| 58 |
plot(y) |
| 59 |
|
| 60 |
# tanglegram(highlight_distinct_edges(x, y),y) |
| 61 |
# dend_diff(x, y) |
| 62 |
\dontrun{ |
| 63 |
|
| 64 |
# using highlight_distinct_edges combined with dendlist and set |
| 65 |
# to clearly highlight "stable" branches. |
| 66 |
data(iris) |
| 67 |
ss <- c(1:5, 51:55, 101:105) |
| 68 |
iris1 <- iris[ss, -5] \%>\% |
| 69 |
dist() \%>\% |
| 70 |
hclust(method = "single") \%>\% |
| 71 |
as.dendrogram() |
| 72 |
iris2 <- iris[ss, -5] \%>\% |
| 73 |
dist() \%>\% |
| 74 |
hclust(method = "complete") \%>\% |
| 75 |
as.dendrogram() |
| 76 |
iris12 <- dendlist(iris1, iris2) \%>\% |
| 77 |
set("branches_k_color", k = 3) \%>\% |
| 78 |
set("branches_lwd", 3) \%>\% |
| 79 |
highlight_distinct_edges(value = 1, edgePar = "lwd") |
| 80 |
iris12 \%>\% |
| 81 |
untangle(method = "step2side") \%>\% |
| 82 |
tanglegram( |
| 83 |
sub = "Iris dataset", main_left = "'single' clustering", |
| 84 |
main_right = "'complete' clustering" |
| 85 |
) |
| 86 |
} |
| 87 |
|
| 88 |
} |
| 89 |
\seealso{ |
| 90 |
\link{distinct_edges}, \link{highlight_distinct_edges}, |
| 91 |
\link{dist.dendlist}, \link{tanglegram} |
| 92 |
\link{assign_values_to_branches_edgePar}, |
| 93 |
\link[distory]{distinct.edges}, |
| 94 |
} |