Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/dataResampling.R
resamp.phy
is used to shuffle tips subtended by a set of internal nodes determining by divergence time or specified by the user
1 | resamp.phy(phy, node = NULL, time.threshold = 1, proportion = TRUE)
|
phy |
a phylogenetic tree of class |
node |
numeric value(s), specifying the internal node(s) whose tips to shuffle; see |
time.threshold |
either absolute or relative divergence times, used to define clades within which tips will be shuffled |
proportion |
if |
Either a numeric vector is supplied for node
or a time.threshold
. If given a set of node
s, this
function will naively shuffle tips descended from the nodes in the order supplied (without regard to whether any internal node
in the vector is a descendant of any other node in the node
vector). If given a time.threshold
, tips will be reshuffled
within non-nested clades that have a rootmost node that occurs within the range [0, time.threshold]
. Note that regard to
absolute divergence times can be enforced with proportion=FALSE
. Note further that resamp.phy(phy=phy, node=NULL, node.threshold=1, proportion=TRUE)
achieves the same effect as resamp.1s
.
a phylogenetic tree whose tips have been shuffled (without any modification of the underlying topology)
Jonathan Eastman
HARDY OJ. 2008. Testing the spatial phylogenetic structure of local communities: statistical performances of different null models and test statistics on a locally neutral community. Journal of Ecology 96:914-926.
see nodelabels
for values given for internal nodes and how these are retrieved
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # load a tree
data(sp.example)
attach(sp.example)
plot(phy)
mtext("original phylogeny")
# reshuffle within a time range
time=1/3
bb=branching.times(phy)
bb=bb/max(bb)
nodes=(Ntip(phy)+1):max(phy$edge)
nodes[bb<=time]=1
dev.new()
plot(resamp.phy(phy, time.threshold=time, proportion=TRUE))
mtext("reshuffled phylogeny showing affected nodes")
nodelabels(cex=ifelse(nodes==1, 2, NA), col=ifelse(nodes==1, 1, NA), pch=19)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.