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