linearMrca: Linear MRCA function

Description Usage Arguments Author(s) Examples

View source: R/metrics.R

Description

Function to make the most recent common ancestor (MRCA) matrix of a tree, where entry (i,j) gives the MRCA of tips i and j. The function is linear, exploiting the fact that the tree is rooted.

Usage

1
linearMrca(tree, k = 0)

Arguments

tree

an object of the class phylo which should be rooted.

k

(optional) number of tips in tree, for faster computation

Author(s)

Michelle Kendall michelle.louise.kendall@gmail.com

Examples

1
2
3
4
5
## generate a random tree
x <- rtree(6)

## create matrix of MRCAs: entry (i,j) is the node number of the MRCA of tips i and j
linearMrca(x,6)

treescape documentation built on May 19, 2017, 3:32 p.m.