Learn R Programming

phytools (version 1.2-0)

phylomorphospace3d: Creates tree-dimensional phylomorphospace plot

Description

This function creates a phylomorphospace plot for three characters using the 3D visualization package, 'rgl'.

Usage

phylomorphospace3d(tree, X, A=NULL, label=TRUE, control=list(), 
   method=c("dynamic","static"), ...)

Value

This function creates a three dimensional phylomorphospace plot. The function returns a function from spin3d (for method="dynamic"); or a series of functions from scatterplot3d (for method="static").

Arguments

tree

a phylogenetic tree in "phylo" format.

X

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

A

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

label

logical value indicating whether to print tip labels next to terminal nodes in the plot (presently doesn't do anything, but labels can be dropped using control).

control

a list containing the following optional control parameters: spin: a logical value indicating whether to animate the plot when created; axes: a logical indicating whether to plot the axes; box: a logical value indicating whether to plot in box; simple.axes: logical value indicating whether to replace box and axes with simpler axes; lwd: line widths; ftype: font type ("off" turns off labels altogether); col.edge a vector of colors of length nrow(tree$edge).

method

a string either "dynamic" for a dynamic (animated) plot created using rgl; or "static" for a flat 3D plot created using scatterplot3d and base graphics. The latter has the advantage of being very easy to export in standard format.

...

optional arguments to be passed to scatterplot3d. Most options not available. angle is an important option that does work here.

Author

Liam Revell liam.revell@umb.edu

References

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

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

See Also

fancyTree, phenogram, phylomorphospace

Examples

Run this code
data(anoletree)
data(anole.data)
anole.pca<-phyl.pca(anoletree,anole.data)
if (FALSE) {
phylomorphospace3d(anoletree,scores(anole.pca)[,1:3],
    control=list(spin=FALSE))}
par(cex=0.5)
phylomorphospace3d(anoletree,scores(anole.pca)[,1:3],
    method="static",angle=-30)
par(cex=1)

Run the code above in your browser using DataLab