plot.backbonePhylo: Plots backbone tree with triangles as clades

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/backbonePhylo.R

Description

Function plots a backbone tree (stored as an object of class "backbonePhylo") with triangles as subtrees.

Usage

1
2
## S3 method for class 'backbonePhylo'
plot(x, ...)

Arguments

x

an object of class "backbonePhylo".

...

optional arguments. Includes vscale (to rescale the vertical dimension in plotting), fixed.height (logical value to fix the plotted height of subtree triangles), print.clade.size (logical), fixed.n1 (logical value indicating whether or not to use the fixed triangle height for subtrees containing only one taxon, or to plot as a leaf - defaults to FALSE), and col (a single value, or a vector with names, giving the clade colors), as well as xlim, ylim, and lwd (as well as perhaps other standard plotting arguments).

Value

Plots a tree.

Author(s)

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.

See Also

phylo.toBackbone

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## first create our backbone tree with
## random subtree diversities
tree<-phytools:::lambdaTree(pbtree(n=10),lambda=0.5)
## create a translation table
## leaving a couple of single-taxon clades for fun
tip.label<-sample(tree$tip.label,8)
clade.label<-LETTERS[1:8]
N<-ceiling(runif(n=8,min=1,max=20))
## set crown node depth to 1/2 the maximum depth
depth<-sapply(tip.label,function(x,y) 
	0.5*y$edge.length[which(tree$edge[,2]==
	which(y$tip.label==x))],y=tree)
trans<-data.frame(tip.label,clade.label,N,depth)
rownames(trans)<-NULL
rm(tip.label,clade.label,N,depth)
## here's what trans looks like
trans
## convert
obj<-phylo.toBackbone(tree,trans)
## plot
plot(obj)

Example output

Loading required package: ape
Loading required package: maps
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
  tip.label clade.label  N     depth
1        t3           A 11 0.5209987
2        t7           B  3 0.4694350
3        t2           C 17 0.5515002
4        t1           D  5 0.5814689
5       t10           E  7 0.3918933
6        t6           F  3 0.4898263
7        t9           G 19 0.3918933
8        t5           H  3 0.4898263

phytools documentation built on July 28, 2017, 9:01 a.m.