Description Usage Arguments Value See Also Examples
Given a graph and a leaf, tries to put the root of the graph on the edge leading to the leaf. If not possible (i. e. if the leaf has admixture in its ancestry), puts the root somewhere else.
1 | make_an_outgroup(graph, outgroup = "", all_neutral = FALSE)
|
graph |
An admixture graph. |
outgroup |
A leaf we want to be the outgroup. |
all_neutral |
For when other functions need to root graphs in a neutral way. |
An admixture graph with the given leaf as an outgroup, if possible.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # Here is a little family tree of some dinosaur-like animals.
species <- c("triceratops", "crocodile", "diplodocus", "tyrannosaurus", "chicken")
graph <- five_leaves_graphs[[1]](species)
plot(graph)
# Of course we know that while this is correct as an undirected graph, "crocodile"
# should really be the outgroup.
graph <- make_an_outgroup(graph, "crocodile")
plot(graph)
# Strictly speaking the graph is still a little misleading because unfortunately
# the (non-bird) dinosaurs are extinct :-(
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.