phy.deresolve: collapse phylogenetic nodes into multichotomies

Description Usage Arguments Details Value Author(s) Examples

View source: R/phylogeneticUtilities.R

Description

collapses phylogenetic dichotomies within a temporal range into multichotomies

Usage

1
phy.deresolve(phy, time.range = c(0, 0), relative = TRUE)

Arguments

phy

a phylogenetic tree of class phylo; see read.tree

time.range

a supplied temporal range, within which nodes will be collapsed

relative

whether relative branch lengths are used (e.g., root is 1; present is 0)

Details

If time.range is supplied as a single value, phy.deresolve will assume that the user intended a range whose minimum is zero (i.e., present; see Examples below). If no nodes are present within the supplied time.range, the tree will be returned unadulterated.

Value

A phylogenetic tree of class phylo

Author(s)

Jonathan Eastman, based on di2multi by Emmanuel Paradis

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
data(sp.example)
attach(sp.example)

## An example with an internal temporal bin
# arbitrarily transform tree to a root age of 100
phy$edge.length=phy$edge.length*(100/max(branching.times(phy)))

# collapse nodes within the middle half of the tree's history
mulphy=phy.deresolve(phy=phy, time.range=c(0.05, 0.95))

# compare result with original tree
plot(mulphy, show.tip.label=FALSE)
mtext("multifurcations in the middle nine-tenths")
dev.new()
plot(phy, show.tip.label=FALSE)
mtext("original phylogeny")

## An example with time.range given by a single value
mulphy=phy.deresolve(phy=phy, time.range=0.25) # affects the most recent quarter of the tree
dev.new()
plot(mulphy, show.tip.label=FALSE)
mtext("multifurcations in the most recent quarter")

## An example showing effect of 'relative'
phy$edge.length=phy$edge.length*(100/max(branching.times(phy)))
dev.new()
plot(dd<-phy.deresolve(phy=phy, time.range=c(0,1), relative=FALSE))
mtext("relative = FALSE")
dev.new()
plot(rr<-phy.deresolve(phy=phy, time.range=c(0,1), relative=TRUE))
mtext("relative = TRUE")

spacodiR documentation built on May 2, 2019, 8:26 a.m.