cor.dendlist: Correlation matrix between a list of trees.

Description Usage Arguments Value See Also Examples

View source: R/cor.dendlist.R

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 intersect_trees to have them matched.

Usage

1
2
3
4
5
cor.dendlist(
  dend,
  method = c("cophenetic", "baker", "common_nodes", "FM_index"),
  ...
)

Arguments

dend

a dendlist of trees

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.

...

passed to cor functions.

Value

A correlation matrix between the different trees

See Also

cophenetic, cor_cophenetic, cor_bakers_gamma, cor_common_nodes, cor_FM_index

Examples

 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
## Not run: 

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")

## End(Not run)

dendextend documentation built on May 9, 2021, 1:06 a.m.