Debian Codegraph @

man/cor_common_nodes.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/cor.dendlist.R
3 \name{cor_common_nodes}
4 \alias{cor_common_nodes}
5 \title{Proportion of commong nodes between two trees}
6 \usage{
7 cor_common_nodes(dend1, dend2, ...)
8 }
9 \arguments{
10 \item{dend1}{a dendrogram.}
11
12 \item{dend2}{a dendrogram.}
13
14 \item{...}{not used.}
15 }
16 \value{
17 A correlation value between 0 to 1 (almost identical trees)
18 }
19 \description{
20 Calculates the number of nodes, in each tree, that are common (i.e.: that have the same exact list of labels).
21 The correlation is between 0 (actually, 2*(nnodes-1)/(2*nnodes), for two trees with
22 the same list of labels - since the top node will always be identical for them).
23 Where 1 means that every node in the one tree, has a node in the other tree with the exact
24 same list of labels.
25 Notice this measure is non-parameteric (it ignores the heights and relative position of the nodes).
26 }
27 \examples{
28
29 set.seed(23235)
30 ss <- sample(1:150, 10)
31 hc1 <- iris[ss, -5] \%>\%
32 dist() \%>\%
33 hclust("com")
34 hc2 <- iris[ss, -5] \%>\%
35 dist() \%>\%
36 hclust("single")
37 dend1 <- as.dendrogram(hc1)
38 dend2 <- as.dendrogram(hc2)
39
40 cor_cophenetic(dend1, dend2)
41 cor_common_nodes(dend1, dend2)
42 tanglegram(dend1, dend2)
43 # we can see we have only two nodes which are different...
44 }
45 \seealso{
46 \link{distinct_edges}, \link{cor.dendlist}
47 }