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

View source: R/utilities.R

orderMappedEdgeR Documentation

Order the columns of mapped.edge to match across trees

Description

Orders the levels of a mapped character to match across trees in a "multiSimmap" object.

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").

Details

This function takes a an object of class "multiSimmap" with a mapped discrete character (e.g., see make.simmap and sorts the columns of each tree$mapped.edge element 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.

Value

An object of class "simmap" or (normally) "multiSimmap".

Author(s)

Liam Revell liam.revell@umb.edu

References

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


phytools documentation built on Nov. 10, 2023, 1:08 a.m.