as.treeshape: Conversion among tree objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

as.treeshape is a generic function which converts an tree object into an object of class "treeshape". There is currently a single method for this generic function.

Usage

1
2
## S3 method for class 'phylo'
as.treeshape(x, model, p, ...)

Arguments

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", "aldous" or "yule" character string.

p

The parameter for the model "biased".

...

Further arguments to be passed to or from other methods.

Details

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 subtree with n tips where n is the size of the polytomy. The subtree is simulated using the PDA, Yule, Aldous or biased model.

Value

An object of class "treeshape" or an object of classes "treeshape" and "randomized.treeshape" if the original tree was not binary.

Author(s)

Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.fr>
Olivier Francois <olivier.francois@imag.fr>

See Also

as.phylo.treeshape

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(ape)
data(bird.orders)
## Data set from APE
plot(bird.orders)
  
## "treeshape" conversion
tree=as.treeshape(bird.orders)
plot(tree)
summary(tree)
 

apTreeshape documentation built on Jan. 8, 2021, 2:07 a.m.