| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/untangle.R |
| 3 |
\name{untangle} |
| 4 |
\alias{untangle} |
| 5 |
\alias{untangle.default} |
| 6 |
\alias{untangle_labels} |
| 7 |
\alias{untangle.dendrogram} |
| 8 |
\alias{untangle.dendlist} |
| 9 |
\title{untangle dendrograms} |
| 10 |
\usage{ |
| 11 |
untangle(dend1, ...) |
| 12 |
|
| 13 |
\method{untangle}{default}(dend1, ...) |
| 14 |
|
| 15 |
untangle_labels(dend1, dend2, ...) |
| 16 |
|
| 17 |
\method{untangle}{dendrogram}( |
| 18 |
dend1, |
| 19 |
dend2, |
| 20 |
method = c("labels", "ladderize", "random", "step1side", "step2side", "stepBothSides", |
| 21 |
"DendSer"), |
| 22 |
... |
| 23 |
) |
| 24 |
|
| 25 |
\method{untangle}{dendlist}( |
| 26 |
dend1, |
| 27 |
method = c("labels", "ladderize", "random", "step1side", "step2side", "DendSer"), |
| 28 |
which = c(1L, 2L), |
| 29 |
... |
| 30 |
) |
| 31 |
} |
| 32 |
\arguments{ |
| 33 |
\item{dend1}{a dendrogram or a dendlist object} |
| 34 |
|
| 35 |
\item{...}{passed to the relevant untangle function} |
| 36 |
|
| 37 |
\item{dend2}{A second dendrogram (to untangle against)} |
| 38 |
|
| 39 |
\item{method}{a character indicating the type of untangle |
| 40 |
heuristic to use. The options are: |
| 41 |
("labels", "ladderize", "random", "step1side", "step2side", "stepBothSides", |
| 42 |
"DendSer")} |
| 43 |
|
| 44 |
\item{which}{an integer vector of length 2, indicating |
| 45 |
which of the trees in the dendlist object should be plotted} |
| 46 |
} |
| 47 |
\value{ |
| 48 |
A \link{dendlist}, with two trees after |
| 49 |
they have been untangled. |
| 50 |
|
| 51 |
If the dendlist was originally larger than 2, it will return the original dendlist |
| 52 |
but with the relevant trees properly rotate. |
| 53 |
} |
| 54 |
\description{ |
| 55 |
One untangle function to rule them all. |
| 56 |
|
| 57 |
This function untangles dendrogram lists (dendlist), |
| 58 |
Using various heuristics. |
| 59 |
} |
| 60 |
\details{ |
| 61 |
This function wraps all of the untangle functions, |
| 62 |
in order to make it easier to find our about (and use) them. |
| 63 |
} |
| 64 |
\examples{ |
| 65 |
\dontrun{ |
| 66 |
set.seed(23235) |
| 67 |
ss <- sample(1:150, 10) |
| 68 |
dend1 <- iris[ss, -5] \%>\% |
| 69 |
dist() \%>\% |
| 70 |
hclust("com") \%>\% |
| 71 |
as.dendrogram() |
| 72 |
dend2 <- iris[ss, -5] \%>\% |
| 73 |
dist() \%>\% |
| 74 |
hclust("sin") \%>\% |
| 75 |
as.dendrogram() |
| 76 |
dend12 <- dendlist(dend1, dend2) |
| 77 |
|
| 78 |
dend12 \%>\% tanglegram() |
| 79 |
|
| 80 |
untangle(dend1, dend2, method = "random", R = 5) \%>\% tanglegram() |
| 81 |
|
| 82 |
# it works, and we get something different: |
| 83 |
set.seed(1234) |
| 84 |
dend12 \%>\% |
| 85 |
untangle(method = "random", R = 5) \%>\% |
| 86 |
tanglegram() |
| 87 |
|
| 88 |
set.seed(1234) |
| 89 |
# fixes it completely: |
| 90 |
dend12 \%>\% |
| 91 |
untangle(method = "random", R = 5) \%>\% |
| 92 |
untangle(method = "step1") \%>\% |
| 93 |
tanglegram() |
| 94 |
# not good enough |
| 95 |
dend12 \%>\% |
| 96 |
untangle(method = "step1") \%>\% |
| 97 |
tanglegram() |
| 98 |
# not good enough |
| 99 |
dend12 \%>\% |
| 100 |
untangle(method = "step2") \%>\% |
| 101 |
tanglegram() |
| 102 |
# How we might wish to use it: |
| 103 |
set.seed(12777) |
| 104 |
dend12 \%>\% |
| 105 |
untangle(method = "random", R = 1) \%>\% |
| 106 |
untangle(method = "step2") \%>\% |
| 107 |
tanglegram() |
| 108 |
} |
| 109 |
} |
| 110 |
\seealso{ |
| 111 |
\link{tanglegram}, \link{untangle_random_search}, |
| 112 |
\link{untangle_step_rotate_1side}, \link{untangle_step_rotate_2side}, |
| 113 |
\link{untangle_DendSer}, |
| 114 |
\link{entanglement} |
| 115 |
} |
| 116 |
\author{ |
| 117 |
Tal Galili |
| 118 |
} |