degradeTree: Randomly collapse nodes on a phylogeny
Description
This function removes a proportion of the total nodes in a tree, chosen randomly, collapsing the nodes such that it causes the tree to be more unresolved.
Usage
degradeTree(tree, prop_collapse, node.depth = NA)
Arguments
tree
A tree of class phylo
prop_collapse
Proportion of nodes to collapse
node.depth
Conditions depth of nodes removed. Default is NA (no conditioning).
Value
Returns the modified tree as an object of class phylo
Details
This function can be conditioned to remove nodes of a particular depth with greater probability by setting node.depth to some value between zero (deep nodes close to the root) or one (shallow nodes far from the root).