Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

EnforceOutgroup

Generate a tree with a specific outgroup


Description

Given a tree or a list of taxa, EnforceOutgroup() rearranges the ingroup and outgroup taxa such that the two are sister taxa across the root, without changing the relationships within the ingroup or within the outgroup.

Usage

EnforceOutgroup(tree, outgroup)

## S3 method for class 'phylo'
EnforceOutgroup(tree, outgroup)

## S3 method for class 'character'
EnforceOutgroup(tree, outgroup)

Arguments

tree

Either a tree of class phylo; or (for EnforceOutgroup()) a character vector listing the names of all the taxa in the tree, from which a random tree will be generated.

outgroup

Character vector containing the names of taxa to include in the outgroup.

Value

EnforceOutgroup() returns a tree of class phylo where all outgroup taxa are sister to all remaining taxa, without modifying the ingroup topology.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

For a more robust implementation, see RootTree(), which will eventually replace this function (#30).

Examples

tree <- EnforceOutgroup(letters[1:9], letters[1:3])
plot(tree)

TreeTools

Create, Modify and Analyse Phylogenetic Trees

v1.4.4
GPL (>= 3)
Authors
Martin R. Smith [aut, cre, cph] (<https://orcid.org/0000-0001-5660-1727>), Emmanuel Paradis [cph] (<https://orcid.org/0000-0003-3092-2199>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.