Description Usage Arguments Details Value Author(s) Examples
View source: R/phylogeneticUtilities.R
collapses phylogenetic dichotomies within a temporal range into multichotomies
1 | phy.deresolve(phy, time.range = c(0, 0), relative = TRUE)
|
phy |
a phylogenetic tree of class |
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) |
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.
A phylogenetic tree of class phylo
Jonathan Eastman, based on di2multi
by Emmanuel Paradis
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.