as_ranked | R Documentation |
Convert a tree of class "phylo" to a ranked tree of class "rankedPhylo".
as_ranked(x)
x |
a tree of class "phylo" |
To convert a tree to a ranked tree, the tree needs to be binary (i.e., fully resolved), be rooted, and ultrametric. Typically, such tree would be produced by coalescent process.
Ranked trees are similar to time-trees, only instead of time, we care about the order of the splits.
a ranked tree of class "rankedPhylo"
# this will throw an error, the tree is not ultrametric
x = ape::rtree(5)
try(as_ranked(x))
# coalescent trees can be converted without problem
y = ape::rcoal(5)
as_ranked(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.