pruneTree: Prune a tree.

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

Description

Prunes a tree to retain only part of it, either the clipping, i.e. tips, or the bush, i.e. the roots, to either a date or around a focal lineage. It is intended to work like drop.tip and subclade in ape and like prune.to.date if keepTips=FALSE.

Usage

1
2
3
4
5
pruneTree(pP, focLin=NULL, focDate=NULL,
  keepTips=TRUE, keepFocLin=TRUE,
  letSpeciate=FALSE, letDie=FALSE, pruneDead=FALSE,
  outPhylo=FALSE, collapseBranches=FALSE)
route2root(pP, focLin)

Arguments

pP

An object of class 'paleoPhylo' (see as.paleoPhylo).

focLin

The focal lineage to be pruned or to obtain the route2root from.

focDate

The focal date to be pruned or to.

keepTips

If TRUE (default), then keep the tips from focLin.

keepFocLin

If TRUE (default), then keep the focal lineage, i.e. focLin, in the pruned tree.

letSpeciate

If TRUE, speciations at exactly the cutoff date are taken to have happened

letDie

If TRUE, extinctions at exactly the cutoff date are taken to have happened

pruneDead

If TRUE, remove the extinct lineages.

outPhylo

Convert to an ape object in the output?

collapseBranches

If the pruned tree leaves successive distinct ancestors with persistent but no cladogenesis, then collapse these branches down to a single lineage?

Details

yes, and also of route2root (which calculates the path from a focal lineage back to the root and is used to work the species to retain) and (at the moment) collapseBranches.

Value

An object of class as.paleoPhylo.

Author(s)

Thomas H.G. Ezard t.ezard@soton.ac.uk and Andy Purvis

References

Ezard, T.H.G. & Purvis, A. (2009). paleoPhylo: free software to draw paleobiological phylogenies. Paleobiology 35, 460-464. doi: 10.1666/0094-8373-35.3.460.

See Also

route2root, prune.to.date, as.paleoPhylo, pearson93, berggren95, drawPhylo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
data(pearson93)
p93 <- with(pearson93, as.paleoPhylo(Code, Parent, Start, End, label=Name))

#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
#*#*example 1: around a focal lineage
par(mfrow=c(2,2))
drawPhylo(p93, l2r=TRUE)
#prune this tree around S. triangularis
p93$nm[which(p93$label=="S.triangularis")]
pTt <- pruneTree(p93, "94") #keep the tips
drawPhylo(pTt, l2r=TRUE)
pTr <- pruneTree(p93, "94", keepTips=FALSE) #keep the rest
drawPhylo(pTr, l2r=TRUE)
pTrTt <- pruneTree(p93, "94", 56) #keep the rest
drawPhylo(pTrTt, l2r=TRUE)

#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
#*#*example 2: around a focal date
par(mfrow=c(2,4))
#depending upon screen configuration, you may want to change the window size 
eg1 <- pruneTree(p93, focDate=54.3, keepTips=FALSE)
drawPhylo(eg1, l2r=TRUE, whSpc=0.2, cexLab=1)
eg2 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, pruneDead=FALSE)
drawPhylo(eg2, l2r=TRUE, whSpc=0.2, cexLab=1)
eg3 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letSpeciate=TRUE, pruneDead=TRUE)
drawPhylo(eg3, l2r=TRUE, whSpc=0.2, cexLab=1)
eg4 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letSpeciate=FALSE, pruneDead=TRUE)
drawPhylo(eg4, l2r=TRUE, whSpc=0.2, cexLab=1)
eg5 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letDie=TRUE, pruneDead=TRUE)
drawPhylo(eg5, l2r=TRUE, whSpc=0.2, cexLab=1)
eg6 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letDie=TRUE, pruneDead=FALSE)
drawPhylo(eg6, l2r=TRUE, whSpc=0.2, cexLab=1)
eg7 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letSpeciate=TRUE, letDie=TRUE, pruneDead=TRUE)
drawPhylo(eg7, l2r=TRUE, whSpc=0.2, cexLab=1)
eg8 <- pruneTree(p93, focDate=54.3, keepTips=FALSE, letSpeciate=TRUE, letDie=TRUE, pruneDead=FALSE)
drawPhylo(eg8, l2r=TRUE, whSpc=0.2, cexLab=1)

#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*
#*#*example 2a: what collapseBranches does
par(mfrow=c(2,1))
#depending upon screen configuration, you may want to change the window size 
eg5a <- pruneTree(p93, focDate=54.3, keepTips=FALSE,
  letDie=TRUE, pruneDead=TRUE)
drawPhylo(eg5a, l2r=TRUE, whSpc=0.2, cexLab=1)
eg5b <- pruneTree(p93, focDate=54.3, keepTips=FALSE,
  letDie=TRUE, pruneDead=TRUE, collapseBranches=TRUE)
drawPhylo(eg5b, l2r=TRUE, whSpc=0.2, cexLab=1)

paleoPhylo documentation built on May 2, 2019, 6:11 p.m.