Learn R Programming

phytools (version 2.1-1)

phylomorphospace: Creates phylomorphospace plot

Description

Project a phylogeny into morphospace.

Usage

phylomorphospace(tree, X, A=NULL, label=c("radial","horizontal","off"),
    control=list(), ...)
project.phylomorphospace(tree, X, nsteps=200, sleep=0,
    direction=c("to","from","both"), ...)

Value

This function creates a phylomorphospace plot

Arguments

tree

a phylogenetic tree in "phylo" format, or a modified "phylo" object with a mapped discrete character.

X

an n x 2 matrix of tip values for two characters in n species.

A

an optional m x 2 matrix (for m nodes) of values for two traits at internal nodes in the tree - if not supplied, these values will be estimated using fastAnc.

label

string indicating whether to plot the tip labels in the same direction as the terminal edge (label="radial"), horizontally label="horizontal", or not at all "off". label=TRUE and label=FALSE are also acceptable, for compatibility with phytools <= 0.3-03.

control

a list containing the following optional control parameters: col.edge: a vector of edge colors; and col.node: a vector of node colors.

nsteps

for project.phylomorphospace the number of frames in the animation between the phylogeny & the phylomorphospace or vice versa.

sleep

for project.phylomorphospace the time between frames.

direction

for project.phylomorphospace whether to morph "to" a phylomorphospace, "from" a phylomorphospace, or there & back again ("both").

...

optional arguments for plotting, including xlim, ylim, xlab, ylab, lwd, colors, fsize, and node.by.map. colors is only used when there is a mapped discrete character on the tree, in which case control$col.edge is ignored. fsize is relative to the default, which is textxy(...,cx=0.75). node.by.map is a logical value (defaults to FALSE which tells the function whether or not to plot the node colors using the colors of the mapped discrete character. Setting this option to TRUE will cause control$col.node to be ignored. node.size is a vector containing the point size relative to the default (see par for plotted internal nodes and tips, respectively. Defaults to node.size=c(1,1.3). If only one number is provided it will be recycled. axes is a logical value indicating whether or not axes should be plotted (see plot.default. Finally, add indicates whether to add the phylomorphospace to the current plot.

Author

Liam Revell liam.revell@umb.edu

Details

This function creates a phylomorphospace plot (a projection of the tree into morphospace) for two characters following Sidlauskas (2008; Evolution). It will also plot a discrete character mapped on tree.

project.phylomorphospace animates the phylomorphospace projection.

References

Paradis, E., J. Claude, and K. Strimmer (2004) APE: Analyses of phylogenetics and evolution in R language. Bioinformatics, 20, 289-90.

Revell, L. J. (2014) Graphical methods for visualizing comparative data on phylogenies. Chapter 4 in Modern phylogenetic comparative methods and their application in evolutionary biology: Concepts and practice (L. Z. Garamszegi ed.), pp. 77-103.

Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.

Sidlauskas, B. (2008) Continuous and arrested morphological diversification in sister clades of characiform fishes: A phylomorphospace approach. Evolution, 62, 3135-3156.

Examples

Run this code
## load tree & data from Revell & Collar (2009)
data(sunfish.tree)
data(sunfish.data)
## set colors for mapped discrete character
cols<-setNames(c("blue","red"),
    levels(sunfish.data$feeding.mode))
phylomorphospace(sunfish.tree,sunfish.data[,3:2],
    colors=cols,bty="l",ftype="off",node.by.map=TRUE,
    node.size=c(0,1.2),xlab="relative buccal length",
    ylab="relative gape width")
title(main="Phylomorphospace of buccal morphology in Centrarchidae",
    font.main=3)	

Run the code above in your browser using DataLab