
Compute the Kendall distance matrix
kendall.Rd
Kendall's distance measures the depth of the most recent common infector (MRCI) for each pair of nodes with respect to the source (patient 0).
Examples
tree <- data.frame(from = c(1, 1, 2, 2, 3, 3), to = c(2, 3, 4, 5, 6, 7))
kendall(tree)
#> 1 2 3 4 5 6 7
#> 1 0 0 0 0 0 0 0
#> 2 0 1 0 1 1 0 0
#> 3 0 0 1 0 0 1 1
#> 4 0 1 0 2 1 0 0
#> 5 0 1 0 1 2 0 0
#> 6 0 0 1 0 0 2 1
#> 7 0 0 1 0 0 1 2