Convert a tree of class "phylo" to a ranked tree of class "rankedPhylo".
Usage
as_ranked(x)
Value
a ranked tree of class "rankedPhylo"
Arguments
x
a tree of class "phylo"
Details
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.
# this will throw an error, the tree is not ultrametricx = ape::rtree(5)
try(as_ranked(x))
# coalescent trees can be converted without problemy = ape::rcoal(5)
as_ranked(y)