File: cor.dendlist.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 (67 lines) | stat: -rw-r--r-- 1,548 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cor.dendlist.R
\name{cor.dendlist}
\alias{cor.dendlist}
\title{Correlation matrix between a list of trees.}
\usage{
cor.dendlist(
  dend,
  method = c("cophenetic", "baker", "common_nodes", "FM_index"),
  ...
)
}
\arguments{
\item{dend}{a \link{dendlist} of trees}

\item{method}{a character string indicating which correlation coefficient
is to be computed. One of "cophenetic" (default),  "baker",
"common_nodes", or "FM_index".
It can be abbreviated.}

\item{...}{passed to cor functions.}
}
\value{
A correlation matrix between the different trees
}
\description{
A correlation matrix between a list of trees.

Assumes the labels in the two trees fully match. If they do not
please first use \link{intersect_trees} to have them matched.
}
\examples{

\dontrun{

set.seed(23235)
ss <- sample(1:150, 10)
dend1 <- iris[ss, -5] \%>\%
  dist() \%>\%
  hclust("com") \%>\%
  as.dendrogram()
dend2 <- iris[ss, -5] \%>\%
  dist() \%>\%
  hclust("single") \%>\%
  as.dendrogram()
dend3 <- iris[ss, -5] \%>\%
  dist() \%>\%
  hclust("ave") \%>\%
  as.dendrogram()
dend4 <- iris[ss, -5] \%>\%
  dist() \%>\%
  hclust("centroid") \%>\%
  as.dendrogram()
#    cutree(dend1)
cors <- cor.dendlist(dendlist(d1 = dend1, d2 = dend2, d3 = dend3, d4 = dend4))

cors

# a nice plot for them:
library(corrplot)
corrplot(cor.dendlist(dend1234), "pie", "lower")
}
}
\seealso{
\link{cophenetic}, \link{cor_cophenetic}, \link{cor_bakers_gamma},
\link{cor_common_nodes}, \link{cor_FM_index}
}