| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/dendlist.R |
| 3 |
\name{dendlist} |
| 4 |
\alias{dendlist} |
| 5 |
\alias{plot.dendlist} |
| 6 |
\title{Creating a dendlist object from several dendrograms} |
| 7 |
\usage{ |
| 8 |
dendlist(..., which) |
| 9 |
|
| 10 |
\method{plot}{dendlist}(x, which = c(1L, 2L), ...) |
| 11 |
} |
| 12 |
\arguments{ |
| 13 |
\item{...}{several dendrogram/hclust/phylo or dendlist objects |
| 14 |
If an object is hclust or phylo - it will be converted |
| 15 |
into a dendrogram.} |
| 16 |
|
| 17 |
\item{which}{an integer vector of length 2, indicating |
| 18 |
which of the trees in the dendlist object should be plotted (relevant for dendlist) |
| 19 |
|
| 20 |
When used inside dendlist, which is still an integer, but it can be of any length, |
| 21 |
and it can be used to create a smaller dendlist.} |
| 22 |
|
| 23 |
\item{x}{a dendlist object} |
| 24 |
} |
| 25 |
\value{ |
| 26 |
A list of class dendlist where each item |
| 27 |
is a dendrogram |
| 28 |
} |
| 29 |
\description{ |
| 30 |
It accepts several dendrograms and or dendlist objects |
| 31 |
and chain them all together. |
| 32 |
This function aim to help with the usability of |
| 33 |
comparing two or more dendrograms. |
| 34 |
} |
| 35 |
\details{ |
| 36 |
It there are list() in the ..., they are omitted. |
| 37 |
If ... is missing, it returns an empty dendlist. |
| 38 |
} |
| 39 |
\examples{ |
| 40 |
|
| 41 |
\dontrun{ |
| 42 |
|
| 43 |
dend <- iris[, -5] \%>\% |
| 44 |
dist() \%>\% |
| 45 |
hclust() \%>\% |
| 46 |
as.dendrogram() |
| 47 |
dend2 <- iris[, -5] \%>\% |
| 48 |
dist() \%>\% |
| 49 |
hclust(method = "single") \%>\% |
| 50 |
as.dendrogram() |
| 51 |
dendlist(1:4, 5, a = dend) # Error |
| 52 |
# dendlist <- function (...) list(...) |
| 53 |
dendlist(dend) |
| 54 |
dendlist(dend, dend) |
| 55 |
dendlist(dend, dend, dendlist(dend)) |
| 56 |
# notice how the order of |
| 57 |
dendlist(dend, dend2) |
| 58 |
dendlist(dend) \%>\% dendlist(dend2) |
| 59 |
dendlist(dend) \%>\% |
| 60 |
dendlist(dend2) \%>\% |
| 61 |
dendlist(dend) |
| 62 |
dendlist(dend, dend2) \%>\% tanglegram() |
| 63 |
tanglegram(tree1 = dendlist(dend, dend2)) |
| 64 |
|
| 65 |
dend <- iris[1:20, -5] \%>\% |
| 66 |
dist() \%>\% |
| 67 |
hclust() \%>\% |
| 68 |
as.dendrogram() |
| 69 |
dend2 <- iris[1:20, -5] \%>\% |
| 70 |
dist() \%>\% |
| 71 |
hclust(method = "single") \%>\% |
| 72 |
as.dendrogram() |
| 73 |
|
| 74 |
x <- dendlist(dend, dend2) |
| 75 |
plot(x) |
| 76 |
} |
| 77 |
|
| 78 |
} |