Learn R Programming

dendextend (version 0.18.3)

cor.dendlist: Correlation matrix between a list of 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 intersect_trees to have them matched.

Usage

cor.dendlist(x, method = c("cophenetic", "baker"), ...)

Arguments

x
a dendlist of trees
method
a character string indicating which correlation coefficient is to be computed. One of "cophenetic" (default), or "baker", can be abbreviated.
...
Ignored.

Value

  • A correlation matrix between the different trees

See Also

cophenetic, cor_cophenetic, cor_bakers_gamma

Examples

Run this code
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)
cor.dendlist(dendlist(d1 = dend1, d2 = dend2, d3 = dend3, d4 = dend4))

Run the code above in your browser using DataLab