Learn R Programming

geiger (version 1.0-91)

ape2ouch: Convert between ape and ouch formats

Description

Converts phylogenetic trees between ape 'phylo' format (used by geiger, ape, and laser packages) and ouch format (used by the ouch package). The OUCH package can be used for testing the Ornstein-Uhlenbeck model of evolution, among other things. If the tree and data file have taxa that don't match, they will be removed from the analysis.

Usage

ape2ouch(phy, data, data.names=NULL)

Arguments

phy
An object of class phylo
data
Data vector
data.names
Tip names for data vector that match tree species; ignored if data includes names

Value

  • ape2ouch returns the phylogentic tree in ouch format as a list with the following components:
  • dPhenotypic values in ouch format
  • nodeNode list for a phylogenetic tree, ouch format
  • ancestorAncestor list for a phylogenetic tree, ouch format
  • timeBranch times for a phylogenetic tree, ouch format
  • speciesSpecies names for a phylogenetic tree, ouch format

References

Butler, M.A. and A.A. King, 2004. Phylogenetic comparative analysis: a modeling approach for adaptive evolution. American Naturalist 164:683-695.

Examples

Run this code
data(geospiza)
attach(geospiza)

ape2ouch(geospiza.tree, geospiza.data[,1], rownames(geospiza.data))->geospiza.ouch

#Interface with ouch package
library(ouch)

brown.fit(geospiza.ouch$d, geospiza.ouch$node, geospiza.ouch$ancestor, geospiza.ouch$time)

Run the code above in your browser using DataLab