Learn R Programming

geiger (version 0.2-6)

ape2ouch: Convert between ape and ouch formats

Description

Converts phylogenetic trees between ape format (used by geiger, ape, and laser packages) and ouch format (used by the ouch package)

Usage

ape2ouch(phy, data)

Arguments

phy
Phylogenetic tree in ape format
data
Data vector with names that match tip species

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

Geiger2

Examples

Run this code
data(geospiza)
attach(geospiza)
name.check(geospiza.data, geospiza.tree)->r
drop.tip(geospiza.tree, r[[1]])->g.tree

data<-geospiza.data[,1]
names(data)<-rownames(geospiza.data)

ape2ouch(g.tree, 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