densityMap {phytools}R Documentation

Plot posterior density of stochastic mapping on a tree

Description

Function plots a tree with the posterior density for a mapped character from stochastic character mapping on the tree. Since the mapped value is the probability of being in state "1", only binary [0,1] characters are allowed.

Usage

densityMap(trees, res=100, fsize=NULL, ftype=NULL, lwd=3, check=FALSE,
	legend=NULL, outline=FALSE, type="phylogram", direction="rightwards",
	plot=TRUE, ...)
## S3 method for class 'densityMap'
plot(x, ...)

Arguments

trees

set of phylogenetic trees in a modified "multiPhylo" object. Values for a two-state discrete character are mapped on the tree. See make.simmap and read.simmap for details.

res

resolution for gradient plotting. Larger numbers indicate a finer (smoother) gradient.

fsize

relative font size - can be a vector with the second element giving the font size for the legend.

ftype

font type - see options in plotSimmap. As with fsize, can be a vector with the second element giving font type for the legend.

lwd

line width for branches.

check

check to make sure that the topology and branch lengths of all phylogenies in trees are equal.

legend

if FALSE no legend is plotted; if a numeric value, it gives the length of the legend in units of branch length. Default is 0.5 times the total tree length.

outline

logical value indicating whether or not to outline the branches of the tree in black.

type

type of plot desired. Options are "phylogram" for a rightward square phylogram; and "fan" for a circular phylogram.

plot

logical value indicating whether or not to plot the tree. If plot=FALSE then an object of class "densityMap" will be returned without plotting.

direction

plotting direction for type="phylogram".

x

for plot.densityMap, an object of class "densityMap".

...

optional arguments for plot.densityMap. These include all the arguments of densityMap except trees and res. Additional optional arguments include mar (margins), offset (tip label offset), and hold (whether or not to use dev.hold to hold output to graphical device before plotting; defaults to hold=TRUE).

Value

Plots a tree and returns an object of class "densityMap" invisibly.

Author(s)

Liam Revell liam.revell@umb.edu

References

Bollback, J. P. 2006. Stochastic character mapping of discrete traits on phylogenies. BMC Bioinformatics, 7, 88.

Huelsenbeck, J. P., R. Neilsen, and J. P. Bollback. 2003. Stochastic mapping of morphological characters. Systematic Biology, 52, 131-138.

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

Revell, L. J. 2013. Two new graphical methods for mapping trait evolution on phylogenies. Methods in Ecology and Evolution, 4, 754-759.

See Also

make.simmap, plotSimmap, read.simmap


[Package phytools version 0.4-60 Index]