| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/all.equal.R |
| 3 |
\name{all.equal.dendrogram} |
| 4 |
\alias{all.equal.dendrogram} |
| 5 |
\alias{all.equal.dendlist} |
| 6 |
\title{Global Comparison of two (or more) dendrograms} |
| 7 |
\usage{ |
| 8 |
\method{all.equal}{dendrogram}(target, current, |
| 9 |
use.edge.length = TRUE, |
| 10 |
use.tip.label.order = FALSE, |
| 11 |
use.tip.label = TRUE, |
| 12 |
use.topology = TRUE, |
| 13 |
tolerance = .Machine$double.eps^0.5, |
| 14 |
scale = NULL, ...) |
| 15 |
|
| 16 |
\method{all.equal}{dendlist}(target, current, ...) |
| 17 |
} |
| 18 |
\arguments{ |
| 19 |
\item{target}{an object of type \link{dendrogram} or \link{dendlist}} |
| 20 |
|
| 21 |
\item{current}{an object of type \link{dendrogram}} |
| 22 |
|
| 23 |
\item{use.edge.length}{logical (TRUE). If to check branches' heights.} |
| 24 |
|
| 25 |
\item{use.tip.label.order}{logical (FALSE). If to check labels are in the same and in identical order} |
| 26 |
|
| 27 |
\item{use.tip.label}{logical (TRUE). If to check that labels are the same (regardless of order)} |
| 28 |
|
| 29 |
\item{use.topology}{logical (TRUE). If to check teh existence of distinct edges} |
| 30 |
|
| 31 |
\item{tolerance}{the numeric tolerance used to compare the branch lengths.} |
| 32 |
|
| 33 |
\item{scale}{a positive number (NULL as default), comparison of branch height is made after scaling (i.e., dividing) them by this number.} |
| 34 |
|
| 35 |
\item{...}{Ignored.} |
| 36 |
} |
| 37 |
\value{ |
| 38 |
Either TRUE (NULL for attr.all.equal) or a vector of mode "character" describing the differences |
| 39 |
between target and current. |
| 40 |
} |
| 41 |
\description{ |
| 42 |
This function makes a global comparison of two or more dendrograms trees. |
| 43 |
|
| 44 |
The function can get two \link{dendlist} objects and compare |
| 45 |
them using \link{all.equal.list}. If a dendlist is in only "target" |
| 46 |
(and not "current"), it will go through the dendlist and |
| 47 |
compare all of the dendrograms within it to one another. |
| 48 |
} |
| 49 |
\examples{ |
| 50 |
|
| 51 |
\dontrun{ |
| 52 |
|
| 53 |
set.seed(23235) |
| 54 |
ss <- sample(1:150, 10) |
| 55 |
dend1 <- iris[ss, -5] \%>\% |
| 56 |
dist() \%>\% |
| 57 |
hclust("com") \%>\% |
| 58 |
as.dendrogram() |
| 59 |
dend2 <- iris[ss, -5] \%>\% |
| 60 |
dist() \%>\% |
| 61 |
hclust("single") \%>\% |
| 62 |
as.dendrogram() |
| 63 |
dend3 <- iris[ss, -5] \%>\% |
| 64 |
dist() \%>\% |
| 65 |
hclust("ave") \%>\% |
| 66 |
as.dendrogram() |
| 67 |
dend4 <- iris[ss, -5] \%>\% |
| 68 |
dist() \%>\% |
| 69 |
hclust("centroid") \%>\% |
| 70 |
as.dendrogram() |
| 71 |
# cutree(dend1) |
| 72 |
|
| 73 |
all.equal(dend1, dend1) |
| 74 |
all.equal(dend1, dend2) |
| 75 |
all.equal(dend1, dend2, use.edge.length = FALSE) |
| 76 |
all.equal(dend1, dend2, use.edge.length = FALSE, use.topology = FALSE) |
| 77 |
|
| 78 |
all.equal(dend2, dend4, use.edge.length = TRUE) |
| 79 |
all.equal(dend2, dend4, use.edge.length = FALSE) |
| 80 |
|
| 81 |
all.equal(dendlist(dend1, dend2, dend3, dend4)) |
| 82 |
all.equal(dendlist(dend1, dend2, dend3, dend4), use.edge.length = FALSE) |
| 83 |
all.equal(dendlist(dend1, dend1, dend1)) |
| 84 |
} |
| 85 |
} |
| 86 |
\seealso{ |
| 87 |
\link{all.equal}, \link[ape]{all.equal.phylo}, \link{identical} |
| 88 |
} |