convertTreeData: Utilities for Formatting Objects for SURFACE Analysis

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/convertTreeData.R

Description

convertTreeData converts a phylo-formatted tree and a data frame into formats ready to be analyzed with the ouch functions called by surface. convertBack converts an ouchtree to a data frame including regime information, and is called internally by surfaceTreePlot. nameNodes adds unique node labels to a phylo tree to ensure reliable conversion between formats

Usage

1
2
3
convertTreeData(tree, dat)
convertBack(tree, otree, regshifts)
nameNodes(tree)

Arguments

tree

Phylogenetic tree in phylo format: to ensure reliable conversion, should have node labels (e.g. using nameNodes)

dat

Data frame with row names corresponding to the taxa in tree and columns consisting of one or more trait measurements

otree

Phylogenetic tree in ouchtree format

regshifts

Named character vector of regime shifts indicating branches containing shifts (numbered corresponding to otree@nodes) and regime identities (usually lower-case letters)

Value

convertTreeData returns a list with components otree (a phylogenetic tree in ouchtree format) and odata (a data frame containing trait data, with rownames corresponding to otree@labels). convertBack returns a data frame containing original phenotypic data as well as regime assignments of tip taxa. nameNodes returns the input tree, with arbitrary node names added (zzz1, zzz2, etc) to ensure reliable conversion between formats

Author(s)

Travis Ingram

References

Ingram, T. & Mahler, D.L. (2013) SURFACE: detecting convergent evolution from comparative data by fitting Ornstein-Uhlenbeck models with stepwise AIC. Methods in Ecology and Evolution 4: 416-425.

See Also

surfaceBackward, surfaceForward, surfaceTreePlot

Examples

1
2
3
4
data(surfaceDemo)
tree<-surfaceDemo$tree
dat<-surfaceDemo$sim$dat
olist<-convertTreeData(tree,dat)

surface documentation built on Dec. 18, 2020, 5:08 p.m.