Learn R Programming

phyloTop (version 2.1.2)

makePhyloTree: Make phylogenetic tree (internal)

Description

This function is called by getLabGenealogy to turn an edge list and corresponding lengths and root node number into a tree of class phylo

Usage

makePhyloTree(Edges, Lengths, Root)

Value

An object of class phylo. When called by getLabGenealogy this represents the genealogical transmission tree from infectors to infectees.

Arguments

Edges

a two-column matrix representing the edges of a tree. (It corresponds to the $edge entry of a phylo object, although the rows may not be in an expected order.) In each row the first entry is an internal node and the second entry is one of its immediate descendants.

Lengths

a numeric vector of the same length as the columns of Edges. Each entry corresponds to the length of that edge.

Root

the number of the internal node which is to be the root (usually the number of tips + 1)

Author

Caroline Colijn c.colijn@imperial.ac.uk

Michelle Kendall michelle.louise.kendall@gmail.com