Learn R Programming

phytools (version 0.3-72.1)

contMap: Map continuous trait evolution on the tree

Description

Function plots a tree with a mapped continuous character. The mapping is accomplished by estimating states at internal nodes using ML with fastAnc, and the interpolating the states along each edge using equation [2] of Felsenstein (1985).

Usage

contMap(tree, x, res=100, fsize=NULL, ftype=NULL, lwd=4, legend=NULL,
	lims=NULL, outline=TRUE, sig=3, type="phylogram", direction="rightwards", 
	plot=TRUE, ...)
## S3 method for class 'contMap':
plot(x, ...)

Arguments

tree
object of class "phylo".
x
vector of phenotypic trait values for species. names(x) should contain the species names and match tree$tip.label. Or, for plot.contMap, an object of class "contMap".
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, this can be a vector with the second element giving font type for the legend.
lwd
line width for branches.
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.
lims
range for the color map. By default, this will be c(min(x),max(x)), and should always include this range.
outline
logical value indicating whether or not to outline the branches of the tree in black.
sig
the number of decimal places to show on the legend limits.
type
type of plot desired. Options are "phylogram" for a rightward square phylogram; and "fan" for a circular phylogram.
direction
plotting direction for type="phylogram".
plot
logical value indicating whether or not to plot the tree. If plot=FALSE then an object of class "contMap" will be returned without plotting.
...
optional arguments for plot.contMap which include all the arguments of contMap except for tree, x, res, and lims.

Value

  • Plots a tree. An object of class "contMap" is returned invisibly.

References

Revell, L. J. In press. Two new graphical methods for mapping trait evolution on phylogenies. Methods in Ecology and Evolution. Felsenstein, J. 1985. Phylogenies and the comparative method. American Naturalist, 125, 1-15.

See Also

densityMap, fastAnc, plotSimmap