previously produced by the Ward and complete linkage clustering methods
(Fig. 4.9):
# Objects of class "hclust" must be first converted into objects of
# class "dendrogram"
class(spe.ch.ward)
# [1] "hclust"
dend1 <- as.dendrogram(spe.ch.ward)
class(dend1)
# [1] "dendrogram"
dend2 <- as.dendrogram(spe.ch.complete)
dend12 <- dendlist(dend1, dend2)
tanglegram(
untangle(dend12),
sort = TRUE,
common_subtrees_color_branches = TRUE,
main_left = "Ward method",
main_right = "Complete linkage"
)
Hint In order for the tanglegram() result to display the site names (as opposed to
their number in the data set), the code in Sect. 4.3.1 shows how to incorporate the
site labels into an object of class “dist” (here spe.ch) used to compute the
clusterings, by means of function attr().
Ward method
20
21
22
26
27
28
29
30
25
23
24
5
9
15
16
19
17
18
1
13
14
11
12
2
3
7
10
4
6
Complete linkage
20
21
22
26
27
28
29
30
25
23
24
9
5
19
17
18
15
16
10
4
6
1
13
14
11
12
2
3
7
3.5
3.0
2.5
2.0
1.5
1.0
0.5
0.0
0.0
0.2
0.4
0.6
0.8
1.0
1.2
1.4
Fig. 4.9 Pairwise comparison of two dendrograms
78
4 Cluster Analysis
Précédent

- 91/444

Suivant