File: flip_leaves.Rd

package info (click to toggle)
r-cran-dendextend 1.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,888 kB
  • sloc: sh: 13; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (3)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/untangle.R
\name{flip_leaves}
\alias{flip_leaves}
\title{Flip leaves}
\usage{
flip_leaves(dend, leaves1, leaves2, ...)
}
\arguments{
\item{dend}{a dendrogram object}

\item{leaves1}{a vector of leaves order value to flip.}

\item{leaves2}{a (second) vector of leaves order value to flip.}

\item{...}{not used}
}
\value{
A dendrogram object with flipped leaves.
}
\description{
Rotate a branch in a tree so that the locations of two bundles of leaves
are flipped.
}
\details{
This function is based on a bunch of string manipulation functions. There
may be a smarter/better way for doing it...
}
\examples{

\dontrun{
dend1 <- USArrests[1:5, ] \%>\%
  dist() \%>\%
  hclust() \%>\%
  as.dendrogram()
dend2 <- flip_leaves(dend1, c(3, 5), c(1, 2))
tanglegram(dend1, dend2)
entanglement(dend1, dend2, L = 2) # 0.4
}
}
\seealso{
\link{tanglegram}, \link{match_order_by_labels},
\link{entanglement}.
}