| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/cor.dendlist.R |
| 3 |
\name{cor.dendlist} |
| 4 |
\alias{cor.dendlist} |
| 5 |
\title{Correlation matrix between a list of trees.} |
| 6 |
\usage{ |
| 7 |
cor.dendlist( |
| 8 |
dend, |
| 9 |
method = c("cophenetic", "baker", "common_nodes", "FM_index"), |
| 10 |
... |
| 11 |
) |
| 12 |
} |
| 13 |
\arguments{ |
| 14 |
\item{dend}{a \link{dendlist} of trees} |
| 15 |
|
| 16 |
\item{method}{a character string indicating which correlation coefficient |
| 17 |
is to be computed. One of "cophenetic" (default), "baker", |
| 18 |
"common_nodes", or "FM_index". |
| 19 |
It can be abbreviated.} |
| 20 |
|
| 21 |
\item{...}{passed to cor functions.} |
| 22 |
} |
| 23 |
\value{ |
| 24 |
A correlation matrix between the different trees |
| 25 |
} |
| 26 |
\description{ |
| 27 |
A correlation matrix between a list of trees. |
| 28 |
|
| 29 |
Assumes the labels in the two trees fully match. If they do not |
| 30 |
please first use \link{intersect_trees} to have them matched. |
| 31 |
} |
| 32 |
\examples{ |
| 33 |
|
| 34 |
\dontrun{ |
| 35 |
|
| 36 |
set.seed(23235) |
| 37 |
ss <- sample(1:150, 10) |
| 38 |
dend1 <- iris[ss, -5] \%>\% |
| 39 |
dist() \%>\% |
| 40 |
hclust("com") \%>\% |
| 41 |
as.dendrogram() |
| 42 |
dend2 <- iris[ss, -5] \%>\% |
| 43 |
dist() \%>\% |
| 44 |
hclust("single") \%>\% |
| 45 |
as.dendrogram() |
| 46 |
dend3 <- iris[ss, -5] \%>\% |
| 47 |
dist() \%>\% |
| 48 |
hclust("ave") \%>\% |
| 49 |
as.dendrogram() |
| 50 |
dend4 <- iris[ss, -5] \%>\% |
| 51 |
dist() \%>\% |
| 52 |
hclust("centroid") \%>\% |
| 53 |
as.dendrogram() |
| 54 |
# cutree(dend1) |
| 55 |
cors <- cor.dendlist(dendlist(d1 = dend1, d2 = dend2, d3 = dend3, d4 = dend4)) |
| 56 |
|
| 57 |
cors |
| 58 |
|
| 59 |
# a nice plot for them: |
| 60 |
library(corrplot) |
| 61 |
corrplot(cor.dendlist(dend1234), "pie", "lower") |
| 62 |
} |
| 63 |
} |
| 64 |
\seealso{ |
| 65 |
\link{cophenetic}, \link{cor_cophenetic}, \link{cor_bakers_gamma}, |
| 66 |
\link{cor_common_nodes}, \link{cor_FM_index} |
| 67 |
} |