| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/seriate_dendrogram.R |
| 3 |
\name{seriate_dendrogram} |
| 4 |
\alias{seriate_dendrogram} |
| 5 |
\title{Rotates a dendrogram based on a seriation of a distance matrix} |
| 6 |
\usage{ |
| 7 |
seriate_dendrogram(dend, x, method = c("OLO", "GW"), ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{dend}{An object of class \link{dendrogram} or \link{hclust}} |
| 11 |
|
| 12 |
\item{x}{a \link{dist} object.} |
| 13 |
|
| 14 |
\item{method}{a character vector of either "OLO" or "GW": |
| 15 |
"OLO" - Optimal leaf ordering, optimzes the Hamiltonian path length that is restricted by the dendrogram structure - works in O(n^4) |
| 16 |
"GW" - Gruvaeus and Wainer heuristic to optimze the Hamiltonian path length that is restricted by the dendrogram structure} |
| 17 |
|
| 18 |
\item{...}{parameters passed to \link[seriation]{seriate}} |
| 19 |
} |
| 20 |
\value{ |
| 21 |
A dendrogram that is rotated based on the optimal ordering of the distance matrix |
| 22 |
} |
| 23 |
\description{ |
| 24 |
Rotates a dendrogram so it confirms to an order of a provided distance object. |
| 25 |
The seriation algorithm is based on \link[seriation]{seriate}, which tries to find |
| 26 |
a linear order for objects using data in form of a dissimilarity matrix (one mode data). |
| 27 |
|
| 28 |
This is useful for heatmap visualization. |
| 29 |
} |
| 30 |
\examples{ |
| 31 |
\dontrun{ |
| 32 |
# library(dendextend) |
| 33 |
d <- dist(USArrests) |
| 34 |
hc <- hclust(d, "ave") |
| 35 |
dend <- as.dendrogram(hc) |
| 36 |
|
| 37 |
heatmap(as.matrix(USArrests)) |
| 38 |
|
| 39 |
dend2 <- seriate_dendrogram(dend, d) |
| 40 |
heatmap(as.matrix(USArrests), Rowv = dend) |
| 41 |
} |
| 42 |
} |
| 43 |
\seealso{ |
| 44 |
\code{\link[dendextend]{rotate}}, \link[seriation]{seriate} |
| 45 |
} |