make_an_outgroup: Make an outgroup.

Description Usage Arguments Value See Also Examples

View source: R/propose.R

Description

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.

Usage

1
make_an_outgroup(graph, outgroup = "", all_neutral = FALSE)

Arguments

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.

Value

An admixture graph with the given leaf as an outgroup, if possible.

See Also

make_permutations

four_leaves_graphs

five_leaves_graphs

six_leaves_graphs

seven_leaves_graphs

eight_leaves_trees

fit_permutations_and_graphs

fit_graph_list

add_a_leaf

add_an_admixture

add_an_admixture2

Examples

 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 :-(

mailund/admixture_graph documentation built on May 21, 2019, 11:06 a.m.