Root1: Roots phylogenetic trees even if outgroup is not monophyletic

View source: R/root1.r

Root1R Documentation

Roots phylogenetic trees even if outgroup is not monophyletic

Description

Root1 non-interactively reroots a phylogenetic tree with respect to the specified outgroup even if it is not monophyletic.

Usage

Root1(phy, outgroup, select=1, ...)

Arguments

phy

An object of class "phylo".

outgroup

A vector of mode numeric or character specifying the new outgroup.

select

Which element of outgroup to select if it is not monophyletic.

...

Arguments passed to ape::root().

Details

This is a wrapper of ape::root() to use in non-interactive mode. If specified outgroup is not monophyletic, instead of error, it issues error _message_, and chooses the 'select' element as a new outgroup.

Value

An object of class "phylo"

Author(s)

Alexey Shipunov

See Also

ape::root

Examples

data(bird.orders, package="ape")
ape::root(bird.orders, 1:2)
## ape::root(bird.orders, 1:3) # gives error
Root1(bird.orders, 1:3) # only outputs error _message_
Root1(bird.orders, 1, resolve.root=TRUE)

shipunov documentation built on Feb. 16, 2023, 9:05 p.m.

Related to Root1 in shipunov...