as.treeshape {apTreeshape} | R Documentation |
as.treeshape
is a generic function which converts an object into a tree of class "treeshape"
. There are currently one method for this generic for objects of class "phylo"
## S3 method for class 'phylo': as.treeshape(x, model, p, ...)
x |
An object to be converted into another class. Currently, it must be an object of class "phylo" . |
model |
The model to use when the tree to convert is not binary. If NULL (default), the tree is not converted. One of "biased" , "pda" or "yule" to use this model to resolve polytomies. |
p |
The parameter for the model "biased" . |
... |
Further arguments to be passed to or from other methods. |
as.treeshape
can convert trees that are not binary. When trying to convert a tree with polytomies, this function may either reject the tree (if model=NULL
) or simulate the tree. The polytomy is replaced by a randomized tree with n tips, where n is the size of the polytomy. The subtree is simulated using the PDA, Yule or biased model.
An object of class "treeshape"
or an object of class "treeshape"
and "randomized-tree"
if the original tree was not binary.
Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Olivier Francois <olivier.francois@imag.fr>
as.phylo.treeshape
dbtreeshape
for examples about polytomy resolutions.
library(ape) data(bird.orders) ## Data set from APE plot(bird.orders) ## "treeshape" conversion tree=as.treeshape(bird.orders) plot(tree) summary(tree)