tree2Paths: Generate a phenotype paths vector from a phenotype tree

Description Usage Arguments Details Value

View source: R/RERfuncs.R


tree2Paths generates a phenotype paths vector matching the treesObject from a tree where branches specify phenotypes.


tree2Paths(tree, treesObj, binarize = NULL, useSpecies = NULL)



A phenotype tree, with branch length encoding a phenotype.


A treesObject created by readTrees


Force binary path representation. Default action depends upon the type of data within the phenotype tree (binary or continuous).

  • If binary (all branch lengths == 0 or 1): Sets all positive path values to 1. Useful if the tree has non-zero branch lengths for an internal branch or branches; otherwise, values are simply added along branches when calculating paths. Default behavior: binarize = TRUE.

  • If continuous (not all branch lengths == 0 or 1): Sets all path values > the mean to 1 and all those <= the mean to 0. Converts a continuous phenotype to a binary phenotype, with state determined by comparison to the mean across all paths. Default behavior: binarize = FALSE.


Give only a subset of the species to use for ancestral state reconstruction (e.g., only those species for which the trait can be reliably determined).


The tree topology of the phenotype tree must match that of the master tree within the treesObject.


A vector of length equal to the number of paths in treesObj

nclark-lab/RERconverge documentation built on Dec. 3, 2018, 7:12 p.m.