Learn R Programming

ouch (version 1.1-1)

tree.plot: Validating and plotting phylogenetic trees.

Description

Validate or plot the phylogenetic tree in ouch format.

Usage

is.valid.ouch.tree(node, ancestor, times, regimes = NULL)
tree.plot(node, ancestor, times, names = NULL, regimes = NULL)

Arguments

node
A character vector giving the name of each node.
ancestor
Specification of the topology of the phylogenetic tree. This is in the form of a character vector naming the immediate ancestor of each node. In particular, the i-th name is that of the ancestor of the i-th node. The root node is distinguis
times
A vector of nonnegative numbers, one per node in the tree, specifying the time at which each node is located. The root node should be assigned time 0.
names
Optional vector of species names.
regimes
A vector of codes, one for each node in the tree, specifying the selective regimes hypothesized to have been operative. Corresponding to each node, enter the code of the regime hypothesized for the branch segment terminating in that node.

Details

tree.plot makes a simple plot of the phylogenetic tree. Labels and/or a selective-regime-based coloring scheme are optional.

is.valid.ouch.tree performs several checks to make sure that the tree is valid. These include checks to ensure that all the vector arguments are of the same length, that the nodes have unique names, that there is a unique root, that there is at least one terminal node, that every node's ancestor is in fact part of the tree, that there are no cycles in the 'tree', and that the tree is connected. It returns TRUE if the tree is valid, FALSE otherwise and gives diagnostic warnings.

Examples

Run this code
data(bimac)
attach(bimac)
is.valid.ouch.tree(node,ancestor,time,OU.LP)
tree.plot(node,ancestor,time,species,OU.LP)

Run the code above in your browser using DataLab