File: rank_branches.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 (48 lines) | stat: -rw-r--r-- 1,309 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
45
46
47
48
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attr_access.R
\name{rank_branches}
\alias{rank_branches}
\title{Rank branches' heights}
\usage{
rank_branches(dend, diff_height = 1, ...)
}
\arguments{
\item{dend}{a dendrogram object}

\item{diff_height}{Numeric scalar (1). Affects the difference in height
between two branches.}

\item{...}{not used}
}
\value{
A dendrogram, after adjusting the height attr in all of its branches.
}
\description{
Adjust the height attr in all of the dendrogram nodes so that
 the tree will have a distance of 1 unit between each parent/child nodes.
 It can be thought of as ranking the branches between themselves.

 This is intended for easier comparison of the topology of two trees.

 Notice that this function changes the height of all the leaves into 0,
 thus erasing the effect of \link{hang.dendrogram} (which should be run
 again, if that is the visualization you are intereted in).
}
\examples{

# define dendrogram object to play with:
dend <- USArrests[1:5, ] \%>\%
  dist() \%>\%
  hclust() \%>\%
  as.dendrogram()

par(mfrow = c(1, 3))

plot(dend)
plot(rank_branches(dend))
plot(hang.dendrogram(rank_branches(dend)))
}
\seealso{
\link{get_branches_heights}, \link{get_childrens_heights},
\link{hang.dendrogram}, \link{tanglegram}
}