Learn R Programming

phytools (version 0.1-9)

fancyTree: Plots special types of phylogenetic trees

Description

This function plots different types of phylogenetic trees. If type="extinction" the function will plot a tree in which branches preceding the MRCA of all extant taxa and branches leading only to extnct lineages are plotted with dashed red lines. If type="traitgram3d" the function will plot a three dimensional traitgram (that is, a projection of the tree into three dimensional morphospace where two dimensions are the phenotypic trait and the third axis is time since the root). In the latter case, the additional argument X, a matrix containing the tip values of all species (with species IDs as row names) should be supplied. Optionally, the user can also supply the matrix A, which contains the ancestral states in the tree with rows labeled by node number. Presently only type="traitgram3d" uses the list control which can be supplied the same set of control parameters as phylomorphospace3d, as well as the control parameter maxit which will be passed to anc.ML.

Usage

fancyTree(tree,type=c("extinction","traitgram3d"),...,control=list())

Arguments

tree
a phylogenetic tree in "phylo" format.
type
the type of special plot to create. See Description.
...
arguments to be passed to different methods.
control
a list of control parameters, depending on type.

Value

  • This function plots different types of phylogenetic trees.

See Also

phenogram, phylomorphospace3d, plot.phylo, plotSimmap

Examples

Run this code
# plot tree with extinction
	set.seed(10)
	tree<-rlineage(1,0.5,4)
	fancyTree(tree,type="extinction")

	# plot 3D traitgram
	tree<-pbtree(n=50,scale=10)
	Y<-sim.corrs(tree,vcv=matrix(c(1,0.75,0.75,1),2,2))
	fancyTree(tree,type="traitgram3d",X=Y,control=list(spin=FALSE))
	
	# plot with internal nodes from simulation
	Y<-sim.corrs(tree,vcv=matrix(c(1,0.75,0.75,1),2,2),internal=TRUE)
	B<-Y[length(tree$tip)+1:tree$Nnode,]; Y<-Y[1:length(tree$tip),]
	fancyTree(tree,type="traitgram3d",X=Y,A=B,control=list(simple.axes=TRUE,spin=FALSE))

Run the code above in your browser using DataLab