plotBranchbyTrait: Plot branch colors by a quantitative trait or value

Description Usage Arguments Details Value Author(s) References

View source: R/plotBranchbyTrait.R

Description

Function plots a tree with branches colored by the value for a quantitative trait or probability, by various methods. Unlike most other tree plotting functions in phytools, this function calls plot.phylo (not plotSimmap) internally.

Usage

1
2
plotBranchbyTrait(tree, x, mode=c("edges","tips","nodes"), palette="rainbow", 
   legend=TRUE, xlims=NULL, ...)

Arguments

tree

an object of class "phylo".

x

either a vector of states for the edges, tips, or nodes of the tree (for mode="edges", "tips", and "nodes", respectively).

mode

string indicating plotting mode. mode="edges", the default, requires that the mapping state of each edge in the tree should be provided. mode="tips" takes the tip values and estimates the state at each internal node. The mapped character value along each branch is the average of the nodes subtending that branch. mode="nodes" similar to "tips", except that the node values are provided instead of estimated.

palette

color palette to translate character values to color. Options are presently "rainbow" (the default), "heat.colors", and "gray". palette can also be a function produced by colorRampPalette.

legend

can be a logical value (TRUE or FALSE) or a numeric value greater than 0. In the latter case the numeric value gives the length of the plotted legend, which also acts as a scale bar for the branch lengths of the tree.

xlims

range for the translation map between trait values and the color map. Should be inclusive of all the values in x.

...

other optional arguments to be passed to plot.phylo - pretty much all arguments are available. In addition, there plotBranchbyTrait has the following additional optional arguments: tol a small tolerance value to be added to the range of x; prompt for legend=TRUE, a logical value indicating whether to prompt for the position of the legend (or not) - the default is to put the legend in the lower left hand size of the plot; title for legend=TRUE, the title of the legend; and digits for legend=TRUE, the number of digits in the quantitative scale of the legend.

Details

Note that if prompt=TRUE, the function will prompt for the position of the legend.

Value

Plots a phylogeny.

Author(s)

Liam Revell [email protected]

References

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


liamrevell/phytools documentation built on Oct. 26, 2018, 12:37 a.m.