Learn R Programming

phytools (version 0.7-70)

orderMappedEdge: Order the columns of mapped.edge to match across trees

Description

This function takes a modified object of class "multiPhylo" with a mapped discrete character (e.g., see read.simmap and sorts the columns of each tree$mapped.edge to have the same state ordering. This is handy if we want to, for instance, run brownie.lite on a set of mapped trees, and then average the fitted parameter values across trees. The function also works for a single tree.

Usage

orderMappedEdge(trees, ordering=NULL)

Arguments

trees

object of class "phylo" or "multiPhylo".

ordering

ordering for the columns of $mapped.edge. If NULL, then an alphabetical order is assumed. Options are "alphabetical", "numerical", or any specific ordering of the mapped traits (e.g., c("A","B","C").

Value

A modified object of class "phylo" or "multiPhylo".

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.