Learn R Programming

mixtree (version 0.0.1)

patristic: Compute the Patristic distance matrix

Description

The patristic distance is the number of generations separating any two nodes in a transmission tree.

Usage

patristic(tree)

Value

A square, symmetric matrix of patristic distances between nodes.

Arguments

tree

A data frame representing a transmission tree, with the first column containing the infector IDs and the second the infectee IDs.

Examples

Run this code
tree <- data.frame(from = c(1, 1, 2, 2, 3, 3), to = c(2, 3, 4, 5, 6, 7))
patristic(tree)

Run the code above in your browser using DataLab